Ben Rosengart:
> Dear postfix-users,
> I'm looking at implementing a tricky policy, of rewriting sender
> address conditionally on a combination of the client's IP address, and
> the result of a map lookup of the return-path (in LDAP, as it happens).
>
> I understand how to chain smtpd restrictions, but I'm stuck on making
> canonical(5)ization conditional on the output of the restrictions.
> Any advice would be appreciated.
Don't. What you describe smells like N-to-M mappings (i.e. up to
N*M mappings).
The Postfix model is (from N forms, to canonical, to M forms), i.e.
no more than N+M mappings in total.
Postfix canonical mappings transform addresses from external form
to canonical form, which is the internal representation for all
mail handling decisions.
If you need to deliver a different address depending on destination,
then use smtp_generic_maps, to convert from the Postfix-canonical
form to that specific external form.
Wietse