I am trying to setup a mail server using this article. Basically using postfix & dovecot.
I have a test setup which works, but I don't understand some (a lot) of stuff and am trying to rectify that before migrating.
Of the many things, this is the most confusing: I don't understand how the second parameter part of $virtual_mailbox_maps works.
I have the following in main.cf:
virtual_mailbox_maps = hash:/etc/postfix/virtual-mailbox-users
My /etc/postfix/virtual-mailbox-users looks like
user@domain1.com user@domain1.com
user@domain2.com user@domain2.com
etc, etc.
First, where can I find documentation of the second parameter user@domain1.com format, most formats are of the form of a file or directory (as in /a/b/c).
If I replace the second parameter by something else, for example,
user@domain1.com /tmp/foo
then I can send mail to user@domain1.com, but not from, which leads to:
My second question: Is SMTP using the $virtual_mailbox_maps? (And why, since it already has the email address as the key parameter?). Does dovecot use $virtual_mailbox_maps?
(I have lots more questions, but this may help me unravel some. For example, can I have all mail to user@domain*.com delivered to one of the mail boxes, say user@domain1.com?)
(Excuse the declarative nature of the title, my original started with 'How to' but was rejected.)
I did an experiment where I replaced the $virtual_mailbox_maps entry by, for example, user@domain1.com OK
, and delivery worked, but sending email failed (with Sender address rejected: not owned by user). So, the right hand side (value) matters. This is what my first question was about. (I have read the various documents describing format, etc., but can find nothing that talks specifically about the interaction with SMTP.
Addendum: Thanks to @masegaloeh for tracking this down.
The relevant configuration is as follows, and 'googling' smtpd_sender_login_maps
explains the rest.
root@generic:/etc/postfix# postconf -n| grep smtpd_sender
smtpd_sender_login_maps = $virtual_mailbox_maps
smtpd_sender_restrictions = reject_unknown_sender_domain, reject_sender_login_mismatch