[Mimedefang] Adding envelope values to header

Jonas Eckerman jonas_lists at frukt.org
Thu Oct 23 10:46:02 EDT 2003


On Wed, 22 Oct 2003 16:55:20 -0700, Kenneth Porter wrote:

> Anyone have a recipe for adding the envelope values (HELO, sender,
> recipients) as X- headers?

I'm doing it like this:

--8<--
#**********************
# Global variables.
#************************
$smtp_info_sender = "";
--8<--
sub filter_sender ($$$$) {
    my($sender, $ip, $hostname, $helo) = @_;
    $smtp_info_sender = "$sender $hostname [$ip] ($helo)";
    return ('CONTINUE', "Ok, go ahead.");
}
--8<--
sub filter_end ($) {
    my($entity) = @_;
    if (defined($smtp_info_sender) && $smtp_info_sender ne "") {
	    action_add_header("X-SMTP-From", "$smtp_info_sender");
    }
}
--8<--

> Have people settled on any "standard"
> set of headers to copy these to?

I've seen these:
X-Envelope: <recipient>
X-Envelope-To: <recipient>
X-Envelope-From: <sender>
X-Sender: <sender>

Unless you stream mails by recipient you normally only want to add 
recipients when actually storing the mail, as you don't want to add 
all recipients to a mail, just the one this copy of it gets delivered 
to.

And for HELO/EHLO you have the standard Received: headers of course. 
Some servers include the recipient in the Received: header.

Regards
/Jonas

-- 
Jonas Eckerman, jonas_lists at frukt.org
http://www.fsdb.org/





More information about the MIMEDefang mailing list