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.
|