LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-29-2013, 12:01 PM   #1
dugi
LQ Newbie
 
Registered: Oct 2005
Posts: 2

Rep: Reputation: 0
procmail + mount to /var/spool/mail permissions problem


( CentOS 6.4 in Oracle VirtualBox, one virtual hd - ext3, default mount options )
( sendmail 8.14.4 ; procmail 3.22 ; mbox format )

** procmail lines in sendmail.mc:
define(`PROCMAIL_MAILER_PATH', `/usr/bin/procmail')dnl
FEATURE(local_procmail, `', `procmail -t -Y -a $h -d $u')dnl
MAILER(procmail)dnl


There are no /etc/procmailrc, /home/*/.procmailrc, or /home/*/.forward files.
Quotas were not used.

** some other points of interest:
-rwxr-xr-x root:mail /usr/bin/procmail
lrwxrwxrwx root:root /var/mail (pointing to /var/spool/mail)
drwxrwxr-x root:mail /var/spool/mail
drwx------ root:mail /var/spool/mqueue
drwxrwxr-x root:mail /mnt/inbox2


When I use mutt to send an email from user1 to user2 (locally) evthing works fine ...
But if I mount some other location to /var/spool/mail

mount --bind /mnt/inbox2 /var/spool/mail

emails get stuck in /var/spool/mqueue with error

procmail: Couldn't create "/var/spool/mail/user2"
<user2@localhost.localdomain>... Deferred: local mailer (/usr/bin/procmail) exited with EX_TEMPFAIL


But if I force sending messages in the mail queue:

root@localhost ~ # sendmail -v -q

Emails do get delivered just fine to the new location!

Nor setting /mnt/inbox2 to drwxrwxrwx,
nor setting /var/spool/mail/user2 to -rw-rw-rw- helped!
Setting /usr/bin/procmail to root:root did not help either.

When I umount /mnt/inbox2 evthing is back to normal again ... emails from mqueue get delivered to mboxes in /var/spool/mail normally without forcing

In both cases (forced and normal) mbox would be like
-rw------- user2:mail /var/spool/mail/user2

What am I missing here?
Why wouldn't procmail deliver emails to /mnt/inbox2 when it was mounted to /var/spool/mail and had exactly the same settings as /var/spool/mail had before mounting?

Last edited by dugi; 06-29-2013 at 02:28 PM.
 
Old 06-30-2013, 05:54 AM   #2
dugi
LQ Newbie
 
Registered: Oct 2005
Posts: 2

Original Poster
Rep: Reputation: 0
This turned out not to be a Procmail issue ...
SELinux was blocking the emails from being delivered to the mounted location!

SELinux policy in /etc/selinux/config was set to enforcing, which is default to a CentOS6.4 fresh install.

When I changed it to disabled and rebooted emails started being delivered.
It worked on permissive policy as well.

So there is sth more you should do when you want to mount on a SELinux enabled system.
 
Old 06-30-2013, 10:10 AM   #3
slipstreamed
Member
 
Registered: Nov 2010
Posts: 60

Rep: Reputation: 24
Glad that you resloved the problem
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
procmail mail spool dir help n03x3c Linux - Newbie 6 11-13-2008 04:17 AM
procmail: Couldn't create or rename temp file "/var/spool/mail/tmp/.... paul_mat Linux - Software 0 05-02-2006 06:16 PM
Import Mail from /var/spool/mail (sendmail) to a MailDir Format in Postfix shawnbishop Linux - Software 0 04-06-2006 10:44 AM
postfix error procmail: Couldn't create "/var/spool/mail/ bentman78 Linux - Software 4 05-26-2004 12:04 AM
/var/spool/mail Sendmail problem.. chuck77 Linux - General 1 05-31-2002 01:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:37 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration