[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Processing of From: lines...



On Wed, 15 Nov 1995, Jens Petersohn wrote:

> In our current networking setup I would like to be able to process the
> From: lines in the message headers. I know that this is highly non-standard,
> but due to a multitude of non-configurable mailers in our subdomains non-
> the-less quite desirable.

Yep, I have the same requirement. For example, I have one uucp connection,
which insists on using uucp addresses and prepending it's site name to all
addresses. The only way they make sense when transferred to another network
is to strip them off here. (The addresses themselves are actually standards
compliant, so I really can't argue to have them fixed at source,
unfortunately).


> I have analyzed the flow of events in Zmailer 2.2e8, but it appears
> to me that the From: line is dumped/generated long before any of the
> scripts can get a hold of it.

No, actually it's a little more clever than that. I'm not sure when it
actually happens.


> I see how the e and s specs in the envelope can be rewriten (using
> crossbar()), but I have found no way (short of calling external
> programs) in rewriting the header From: lines.

Nope, the headers *can* actually be rewritten in crossbar.cf and canon.cf. Do
a search in there for the 'rewrite' variable in a few places. You'll find
that certain combinations (transport/network to and from) will force
rewriting, as in fact is required at almost any mail gateway where there
aren't homogenous addresses on each side of the gateway. Since I gate three
somewhat incompatible networks here, I had to force rewriting in all cases
and forget about the niceties of preserving "exact" addresses in
internet<->internet mail. It works quite well and to my knowledge have never
had a problem with it. (You should have seen the horrifying sendmail 8.6.x
rulesets I used to use to do the same thing. A few lines changed in two of
zmailer's .cf files did it all and all the exception routing in sendmail.cf
was transferred to $MAILVAR/db/routes, much to my delight). 

Addresses are actually transformed for internal purposes in canon.cf
(specifically the canonicalize() function), and will be rewritten into the
headers if 'rewrite' is asserted in crossbar.cf. I do a few transforms in
there, forced rewriting of everything and now headers lack some silly
brokeness which I'd otherwise have to put up with. 

If you need further details, I'll be happy to send you my modifications so
you can find out the mechanics. I don't claim any special knowledge of
ZMailer's internals - most of it I worked out by studying the .cf files,
taking some educated guesses and with a little trial and error.  I was
actually surprised it was so easy. 


  Regards,
  David