Postfix - Set the reply-to address based on the sent-to address when sending email

StackOverflow https://stackoverflow.com/questions/22876516

  •  28-06-2023
  •  | 
  •  

Pergunta

I have multiple domains which I receive e-mail for and have set up my mailserver to deliver it all to a single mailbox for convenience, example below:

comment@myblog.com
contact@mybusiness.com
admin@mywebsite.com

They all come to me at my single mailbox:

ian@me.com

When I reply to these e-mails the reply-to address will be:

ian@me.com

I would like to automatically have postfix change that reply-to address, based on the address that the e-mail was originally sent to, so for example:

Email is sent to me at: comment@myblog.com
I reply from: ian@me.com
I want the reply-to to be: comment@myblog.com

Is there a way to automate this with postfix?
Thanks in advance.

Foi útil?

Solução

  • It is doable in postfix anyway. But it requires some programming to parse the mail to determine the recipient email address and add Reply-To header from that value. You need to use an external content filter or a Milter application. But I dont think it is a cleaner way.

  • I would rather say that setting Reply-To header should be done by the MUA eg. (Thunderbird, Outlook etc ) instead of Postfix MTA. For eg. in Thunderbird, If you receive all your emails for

    comment@myblog.com
    contact@mybusiness.com
    admin@mywebsite.com
    

    at ian@me.com, then you can add identities for all the email addresses above( You can set your Name, Email address, Reply-To address etc). So when you reply to an email sent to comment@myblog.com, then the Reply-To address will be set to comment@myblog.com. For Thunderbird, you have to add identities by clicking Edit -> Account Settings -> Manage Identities. More info here. All MUAs should have this option of managing identities.

Hope that helps.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top