I have CentOS 5.5 with Postfix installed on it. I want to use local delivery agent with default setting, but I want it to store mail with Maildir directory style mailboxes.
When I set the mailboxes to be stored ( as default ) in:
mail_spool_directory = /var/spool/mail/
And I manually create maildir, so it looks like this:
[root@dx2200 /]# ls -lah /var/spool/mail/
total 32K
drwxrwxr-x 4 root mail 4.0K Mar 15 15:01 .
drwxr-xr-x 13 root root 4.0K Mar 15 14:33 ..
drwxr-xr-x 5 root root 4.0K Mar 15 14:52 marshra
drwxr-sr-x 5 pedro mail 4.0K Mar 15 15:01 pedro
[root@dx2200 /]#
[root@dx2200 /]# ls -lah /var/spool/mail/pedro/
total 40K
drwxr-sr-x 5 pedro mail 4.0K Mar 15 15:01 .
drwxrwxr-x 4 root mail 4.0K Mar 15 15:01 ..
drwxr-sr-x 2 pedro mail 4.0K Mar 15 15:01 cur
drwxr-sr-x 2 pedro mail 4.0K Mar 15 15:01 new
drwxr-sr-x 2 pedro mail 4.0K Mar 15 15:03 tmp
[root@dx2200 /]#
And then I try to send mail to local user pedro
, the message is not being delivered, and my /var/log/maillog
says:
Mar 15 15:11:00 dx2200 postfix/local[4266]: warning: maildir access problem for UID/GID=1014/1014: error writing message: Permission denied
Mar 15 15:11:00 dx2200 postfix/local[4266]: warning: perhaps you need to create the maildirs in advance
Mar 15 15:11:00 dx2200 postfix/local[4266]: 8D5D11310056: to=<[email protected]>, orig_to=<pedro>, relay=local, delay=0.04, delays=0.02/0.01/0/0.01, dsn=5.3.0, status=bounced (maildir delivery failed: error writing message: Permission denied)
I've had similar problem with virtual delivery agent, and changing virtual_mailbox_base
from /var/spool/vmail
to home directory /home/vmail
did help. Do I have to do it also with local delivery agent ? AND IF SO - why can't I store mail in /var/spool
?