It is necessary to wrap all mail from one client (the IP address from which the letter is sent) or mailbox (From field), in this case they are the only constants, to one specific mail address, and completely ignore the To field. How can this be done by regular means?

PS The only way I found is to enable local delivery of letters to the relay server for a particular client, and then use procmail to redirect the letters further.

  • For reference: in addition to the header to have at least cc and bcc . see tools.ietf.org/html/rfc822#section-4.5 - aleksandr barakin
  • In my particular case, the header data is not used, since automatic personal mailing is carried out. One address - one letter. But really, how not to think about these headlines. Thank! - Anonymus
  • There is an extensive article on the program website about this: postfix.org/ADDRESS_REWRITING_README.html - aleksandr barakin
  • The documentation describes the substitution of the sender, and I also need to replace the recipient when the client's address coincides (the ip of the server from which the user initiated). I see a way: we filter the mail queue on the basis of the client’s address (ip address of the initiator of the letter), then we have to wipe the sender and substitute our value, then just spit the letter into the general queue and process it according to standard rules. The catch is that I do not understand how to initiate and implement such a check. - Anonymus
  • Oh, it's already about the ip-address. I think the question is to clarify. - aleksandr barakin

1 answer 1

Pre-notification: did not check performance. The answer is based only on this information and the contents of man 5 access .


According to man 5 access , you can use the /etc/postfix/access file for the solution.

To do this, add the following line to this file:

 sender@domain1 REDIRECT recipient@domain2 

and execute:

 $ sudo postmap /etc/postfix/access 
  • I tried this method - it does not work. - Anonymus