Thursday, March 8, 2018

email server - Making sure Postfix MDA and Dovecot IMAP understand mailbox location?



I want to setup Postfix and Dovecot with Postfix as the SMTP MTA (mail transfer agent) and the MDA (mail delivery agent) and Dovecot just as the IMAP server, but I want to make sure that they each understand the mailbox location, and I am not totally clear on this from the documentation.



If I use the following settings in the Postfix main.cf (username represents a system user that is setup to handle all virtual users):



virtual_mailbox_base=/home/username
virtual_mailbox_maps=hash:/etc/postfix/vmailbox



And in /etc/postfix/vmailbox (the / at the end of the mailbox path indicates a maildir mailbox):



info@example.com example.com/info/
sales@example.com example.com/sales/


So that the mailboxes would look like /home/username/example.com/info/ and so forth, as described in the documentation (http://www.postfix.org/VIRTUAL_README.html#virtual_mailbox).




And then use the following settings in the Dovecot dovecot.conf:



mail_home=/home/username/%d/%n
mail_location=maildir:~/Maildir


So that Dovecot has separate "home" and mailbox directories for the virtual users, as recommended in the documentation (http://wiki2.dovecot.org/VirtualUsers/Home), will this be a compatible setup?



Or, will Postfix be delivering mail to /home/username/example.com/info in cur, new, and tmp folders while Dovecot is looking for mail in /home/username/example.com/info/Maildir in cur, new, and tmp folders? Does the / to activate a maildir mailbox in the Postfix virtual_mailbox_maps indicate and automatically create a Maildir folder after example.com/info/ or will it create the difficulty I describe above?




Thank you.


Answer



For the above setup to work, the Dovecot dovecot.conf should contain:



mail_location=maildir:~


without the /Maildir


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...