On Sun, 2018-03-25 at 13:49 -0400, Viktor Dukhovni wrote: > > On Mar 25, 2018, at 12:44 PM, [email protected] wrote: > > > > I'm trying to achieve a simple thing. Then user logins via SASL and sends > > mail, I want postfix to check that SASL > > login is identical to MAIL FROM filed. > > Postfix does not support this directly. You'd need a milter or content filter > for that. > One that receives the SASL user name and rewrites the "From" header > accordingly. > > > As I can see, I can do that with 'reject_sender_login_mismatch', but usage > > of this option implies usage of > > 'smtpd_sender_login_maps'. > > Actually, no, because that checks the envelope sender, not the From: header. > > > The problem is that I use MS AD as user list provider, so firstly, I > > thought about some tricky filter to achieve > > this, but I can't think up something workable. > > It should be possible to construct an LDAP query that queries for "mail" and > returns > SAMAccountName. However, that still does not check the fact that you'll be > filtering the envelope sender. > > For the From: header one would want not only the email address that matches > the login name, but also the > displayName. This is not something that Postfix can do directly. > As mentioned above, that'd be a job for a content_filter or milter. > >
Viktor, thank you for your reply ! Your answer have helped me a lot. I should definitely read about mail structure. Will do then I'll have a time for that. Thanks once again. -- Best regards, Mate200
