Le 18/09/2025 à 16:08, R. Diez via Postfix-users a écrit :
Or may be there is some ready-to-use script which automatically replaces both the envelope address and the "From:" header to match the ones associated with the SMTP account, but only for those SMTP accounts listed in some configuration file? This way, not every hoster must implement it all from scratch.


Hi,

I've been looking for something like that for a while and ended up writing my own milter this week.

It behaves as described above: it uses an "identity database", which is a text file that lists every account and the email addresses and display names they are allowed to use.

If an emails is received where the envelope from or header From: doesn't match what the user is allowed to use, the offending sender info gets rewritten.

It rewrites both the email addresses as well as the display name in the From: header of the message.

The thing has been running for a few days on my low-traffic system. It seems to work okay, but it could definitely benefit from more testing, as there are probably corner case that I haven't encountered.

So if anybody is interested, you can get it at https://github.com/antoninverrier/milter-enforce-sender

This milter can be used in "dry run" mode, where it doesn't actually rewrite sender info but just add debugging headers.

Looking forward to feedback.

Thanks,

Antonin
_______________________________________________
Postfix-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to