Noel Jones:
> > It's easy enough to ignore existing Subject: lines, but adding
> > exactly one requires care. The bad news is that PREPEND action (in
> > access, header_checks, body_checks) will prepend text for each match.
> >
> > Adding text once robustly requires changes to Postfix, without
> > entering the slippery slope that ends with a Turing-complete language.
> >
> > Of all the alternatives that I could think of, EOH pseudo pattern,
> > match count options in the regexp/pcre implementation, the only
> > change that seems reasonably implementable is to apply header_checks
> > to an empty line to signal the end of the message header (which
> > means Postfix would have to supply this line when none exists).
> >
> > /^$/ PREPEND Subject: fax from 555-1212
> >
> > Then, new safety code would have to be added so that REPLACE, IGNORE,
> > etc., won't remove an existing blank line from the input stream.
>
> Maybe a PREPENDONCE action that only fires once per message? At any
> rate, this new feature doesn't seem to be worth spending much time on.
This is what I call match counts, and rejected for the following
reason. How would this be implemented with Postfix lookup tables?
There is no interface in Postfix such that the table lookup routine
(regexp, cidr map, hash table, SQL lookup) can know what the
lookup result will be used for, let alone that a right-hand-side
action has already been used. There also is no interface in Postfix
such that the right-hand-side action routine can tell the table
lookup routine (regexp, cidr map, hash table, SQL lookup, ...) to
skip a match.
There is no such conflict with the empty-line (or EOH) header event.
Apart from that, neither the empty line nor the EOH pseudo event
generalizes to end-of-body conditions.
Wietse