Marek Kozlowski: > :-) > > >> Some users forward their incoming mail to some external mail servers. > >> Unfortunately AFAIK with no action taken it may result in breaking the > >> SPF. The solution for this problem I know is rewriting addresses with > >> SRS (postsrsd). Unfortunately postsrsd uses the same settings as > >> canonicals do which in my case is inadvisable because I want canonicals > >> to operate independently of SRS. A few days ago I sent a post regarding > >> this problem. > > > > What is the problem? Perhaps you are unaware that Postfix canonical > > mapping is recursive, and that it can apply multiple mappings. > > I've wrote it on 20.11. Again: > > The recommended configuration of postsrsd is quite simple and as follows > (main.cf): > > sender_canonical_maps = tcp:localhost:10001 > sender_canonical_classes = envelope_sender > recipient_canonical_maps = tcp:localhost:10002 > recipient_canonical_classes= envelope_recipient,header_recipient > > which in my case is: > > sender_canonical_maps = unionmap:{ldap:/etc/postfix/ldap-canonical.cf, > ldap:/etc/postfix/ldap-canonical2.cf, tcp:127.0.0.1:10001}
By design, unionmap can produce multiple results separated by comma. That would be wrong. Why not: sender_canonical_maps = ldap:/etc/postfix/ldap-canonical.cf, ldap:/etc/postfix/ldap-canonical2.cf. tcp:127.0.0.1:10001 That produces one result, and it still ensures that each mapping will be tried. > sender_canonical_classes = envelope_sender > recipient_canonical_maps = tcp:127.0.0.1:10002 > recipient_canonical_classes = envelope_recipient, header_recipient > > due to some necessary address rewriting based on some LDAP attributes > (postsrsd daemon works of 10001 and 10002 ports). For envelope addresses > as well as the `To:' field everything is fine. The problem concerns the > `From:' field: Looks like you need to use SRS to rewrite envelopes, and LDAP to rewrite some headers. Can you use smtp_generic_maps for the LDAP stuff? Wietse