BuzzSaw Code via Postfix-users:
> When someone sends email to one of a list of a few hundred email
> aliases, we would like to add some headers to help drive some of our
> internal processes associated with those aliases. These would only be
> added fot those specific aliases, not for every email.
Postfix implements only single header matches and actions. Multi-header
matches and actions are not built-in because Postfix is primarily an MTA.
I have some content management options below.
> We looked at a large PCRE table generated by a cron job that would
> match on the To: /RCPT_TO address from the header but that only
> supports one action per match and only single line replacements. We
> need to add multiple headers for that match.
>
> We have the attributes that would be needed for the extra headers in
> LDAP, so an ideal solution would be a way to use an LDAP match table
> that then triggers something else that can actually get the attributes
> from LDAP to use for substitution. But that doesn't appear to be
> possible either.
The Postfix LDAP client supports query_filter which can return
any information from your LDAP schema. But like other tables,
it can return only one action per match.
> Would the only way to really do this be a filter module that processes
> every email ?
That is a possibility. If the message matches some pettern, invoke
a FILTER action that runs the message through an external program
and then back into Postfix.
Another option is to use a Milter (bindings exist for many languages
such as pymilter for Python, Sendmail::Milter for Perl, and more)
and to invoke add_header actions in the end-of-message handler.
> I've tried to read up as much as possible on the various documentation
> on mail filtering and processing before asking here.
I suppose you found discussions where people have asked a similar
question?
There is a thread where I mention tables that return multiple actions
as in { prepend foo } {prepend bar } but that would be terribly
unsafe with PCRE, regexp and other tables that substitute part of
the query into the result.
Wietse
_______________________________________________
Postfix-users mailing list -- [email protected]
To unsubscribe send an email to [email protected]