I have to rebuild an ancient mail server configuration for my local theatre club. At the moment, we have sevaral mailinglists that are written as java programs. I want to replace them using mailman and postfix. Besides other configuration stuff such as sending to special lists limited to allowed local email addresses, I have the following problem:
E-Mails sent to our mailserver should get the sender replaced based on a ldap or mysql based lookup (e.g. when sending to firstname.lastname@example.org from email@example.com (or firstname.lastname@example.org or whatever) the sender should be rewritten to email@example.com. If there could no lookup be found, the original sender should be used (or depending on the receipient should be dropped)
how can I achive this using postfix as mailserver? I read about sender_canonical but it seems as this works the other way around (e.g. rewriting local adresses to other adresses)
but what I want to do is to lookup external mail adresses from incoming mail and rewrite them to the local server ones. This solves two problems:
- I dont send e.g. @gmail.com mails with my server.com domain
- when some firstname.lastname@example.org sender sends an email that has a local lookup, the correct user gets placed on the mail
- I only need to track the local email addresses in the allowed sender list of mailman.