Adding Envelope Headers?

John Rudd jrudd at UCSC.EDU
Fri Feb 13 22:17:14 GMT 2004

Kai Schaetzl wrote:

> and still no X-Envelope-From.

IIRC, the propper header for "envelope from" is "Return-Path".  I think
that's in one of the standards.  I know that at least one MTA
(CommuniGate Pro) will take the envelope from and put it into the
Return-Path if there isn't a Return-Path already. (but I'm not sure what
it does if the envelope from doesn't match the return path ... )

> We are currently using a milter which happily adds both headers by default
> and I found that they are very useful for everything concerning anti-spam
> measures, adding to access.db etc. but also for whitelisting. Actually, I
> was quite surprised when first checking out Mailscanner that it doesn't add
> these headers and wonder why it doesn't. Mailscanner seems to be the perfect
> place to do it. Obviously, sendmail doesn't do, that's why several milters
> add them (f.i. amavis-new does it, but why add another milter to the chain
> if I don't need it for other things?).

My interest is slightly different.  There are some mailers out there
that use a queue format that is closer to RFC822 format, and a "modified
RFC822" format that is like this:

(1 or more Envelope-To: headers)
(rest of RFC822 message)

would be an ideal thing, to me, to support for a "plain" MTA in
mailscanner.  Converting to this format would make my CommuniGate Pro
modules trivial, and CommuniGate Pro will take this format directly as a
submission (if the file's name ends with ".sub", so the difference
between a "plain" MTA and a "CGP" MTA would be that it would put the
files into a particular directory (instead of batch mode) and give them
a .sub suffix).  The only thing this leaves out, that mailscanner wants,
is the relay.  Right now, I extract this from the first received
header.  A "plain" MTA for mailscanner could do the same thing.

I would even be happy to see my code for the CGP modules directly used
in this effort. (what they do now is: "cgp2ms" converts a CGP queue file
into a sendmail-like queue file and puts it in mailscanner's
directory; "ms2cgp" is the mailscanner "Sendmail2" variable, and it
takes the sendmail queue format and converts into something CGP can use
... the next version I'm working on of ms2cgp actually converts it into
the above format and sticks in into the CGP "Submitted" directory).
Some of that code might help in making both a "plain" MTA for
mailscanner, and in making a "CGP" MTA for mailscanner.

More information about the MailScanner mailing list