On 11/09/2010 06:15 PM, Toomas Vendelin wrote:
Hi there!
I run Postfix on CentOS 5.5 with virtual domains. Mail is supposed to
be delivered to maildirs.
Don't you mean "I have configured postfix to deliver to maildirs".
If that's not what you mean, it's an unwarranted - and quite dangerous -
assumption.
Everything worked with a sendmail/mbox setup
for the same domain, so MX issues can be eliminated immediately :)
I never considered MX issues until you brought them up - you haven't
mentioned any issue yet.
I'm trying to set up a virtual mail hosting on a testing machine,
following the tutorial at:
http://howtoforge.net/linux_postfix_virtual_hosting
Yesh - tutorials often get things wrong, or assume you know more about
postfix than you do.
I'd suggest the actual documentation instead, located at
http://www.postfix.org/VIRTUAL_README.html
Here's the issue. Message file cannot be written to tmp folder because
of "Permission denied".
Which user is postfix delivering virtual mailbox mail as ?
Did you check that the UID of the virtual user corresponds with write
permissions on the virtual_mailbox_maps location ?
Needless to say, both owherships and
permissions were checked by hand descending from base
(/var/spool/vmail) to the bottom. To check misspelled directory names,
I've copied the full path and run #cd
/var/spool/vmail/minu.biz/toomas/tmp/ - worked fine. I've even tried
to chmod -R 0777 /var/spool/vmail
Don't. Ever. Chmod anything to 777.
(it is a testing machine),
And ?
but even
then I've got the very same "Permission denied".
Run namei -l /var/spool/vmail/minu.biz/toomas/tmp to verify *complete*
access.
Disabling SELinux
didn't work either. Maildirs WERE created in advance, exactly as the
message suggests. It's late, and I'm running out of ideas. Please,
help.
Exerpt from maillog:
<snip>
Nov 9 18:27:46 rh2 postfix/virtual[5144]: warning: maildir access
problem for UID/GID=5000/5000: create maildir file
/var/spool/vmail/minu.biz/toomas/tmp/1289320066.P5144.rh2.tere.com:
Permission denied
Nov 9 18:27:46 rh2 postfix/virtual[5144]: warning: perhaps you need
to create the maildirs in advance
HOW did you create the maildir ?
If postfix created the maildir, it would obviously be able to write to
it afterwards.
Output of postconf -n:
command_directory = /usr/sbin
config_directory = /etc/postfix
daemon_directory = /usr/libexec/postfix
inet_interfaces = all
mail_owner = postfix
mydestination = $myhostname, localhost.$mydomain, localhost
mydomain = $myhostname
myhostname = rh2.tere.com
mynetworks = 192.168.50.0/24
myorigin = $mydomain
queue_directory = /var/spool/postfix
relay_domains = $mydestination
virtual_alias_maps = hash:/etc/postfix/valias
virtual_gid_maps = static:5000
virtual_mailbox_base = /var/spool/vmail
virtual_mailbox_domains = /etc/postfix/vhosts
virtual_mailbox_maps = hash:/etc/postfix/vmaps
virtual_uid_maps = static:5000
This mandates that ALL virtual mailboxes MUST be writable by either uid
5000 or gid 5000. Are they ?
What is the contents of virtual_mailbox_maps ?
You left out one of the principal deciding factors by not including it.
--
J.