4

I'll like to know if there is a way to manage multiple email account just from one. I have about 40 or 50 external POP3 email accounts, is there a way to forward all entry emails from those accounts to just 1, and then when replying from that account the final users sees it from the one he wrote?

Example: users (user@user.com) sends me an email to one of my accounts (email@first.com), that email get forwarded to my personal account (email@personal.com), I reply it from my personal account, but the user (user@user.com) sees that it comes from (email@first.com), and that with all my accounts.

anyway setup to do it? anyway to do it with a custom program?

My server is a Linux based with postfix and dovecot installed.

Thanks

2 Answers2

6

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.

Esa Jokinen
  • 43,252
  • 2
  • 75
  • 122
4

While I guess this is doable with Postfix with quite a bit of effort, I believe it would be easiest to use an MUA that can do this. One (untested) option would be Thunderbird with the "Correct Identity" plugin that claims to be able to choose the identity based on the address you received the mail for when replying.

Why would the postfix layer require effort? The reason is that when you reply to a mail, the original "To:" header is not present anymore for the outgoing mail, so there is no way to rewrite it correctly. To overcome this, you would need to build an environment where you store every incoming message ID and the "To:" header in some kind of database and then consult that database when processing a reply with the "in reply to" header set, get the original "To:" header and rewrite accordingly.

Sven
  • 97,248
  • 13
  • 177
  • 225