You need to be aware that POP3 & IMAP (implemented by Dovecot) are protocols for accessing mailboxes while SMTP (implemented by Postfix) is for sending and receiving mail. Instead of trying to access 50 external POP3 accounts from one you need to deliver all mail to a single account.
Replying from these alternate identities is a feature of your email client rather than the server, but the server needs to be configured to allow this:
- your client needs relay access for all these addresses
- your server needs to be listed as a permitted sender for each domain (in its SPF record).
This is easy to achieve, if all the domains involved are handled by the same server, and almost impossible if the accounts are all on different services, using different configurations handled by different administrators. That's why it's only natural to limit my answer to the situation, where all domains are using the same server as the primary MX and an SPF permitted sender.
Receiving mail from all addresses to a single mail user.
- List all the domains in Postfix
main.cf
configuration parameter virtual_alias_domains
- Use
virtual_alias_maps = hash:/etc/postfix/virtual
and list all the addresses as virtual aliases of your real mailbox (user@example.com yourusername
).
- Use POP3 or IMAP to access the mail account for
yourusername
.
Configuring submission for sending using all the addresses.
- Configure submission in your Postfix
master.cf
; submission inet n - - - - smtpd
- Configure Dovecot to provide SALS authentication to Postfix. (See e.g. this how-to.)
Use the existing virtual
database to match the addresses with your submission login user:
-o smtpd_client_restrictions=permit_sasl_authenticated,reject
-o smtpd_sender_login_maps=hash:/etc/postfix/virtual
-o smtpd_sender_restrictions=reject_sender_login_mismatch
Configure your MUA to use multiple identities with a single account. This is possible for example with Thunderbird Identities and SquirrelMail Multiple Identities.