Skip to content

Commit

Permalink
Merge pull request #26 from bigio/master
Browse files Browse the repository at this point in the history
create a correct Received header if the connection is authenticated
  • Loading branch information
bigio committed Mar 4, 2021
2 parents da02c71 + c69ee7d commit 34ffd6f
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions mimedefang.pl.in
Expand Up @@ -771,20 +771,25 @@ sub synthesize_received_header {
my($hdr);

my($hn) = $SendmailMacros{"if_name"};
my($auth) = $SendmailMacros{"auth_authen"};

my $strdate = rfc2822_date();

$hn = get_host_name() unless (defined($hn) and ($hn ne ""));
if ($RealRelayHostname ne "[$RealRelayAddr]") {
$hdr = "Received: from $Helo ($RealRelayHostname [$RealRelayAddr])\n";
$hdr = "Received: from $Helo ($RealRelayHostname [$RealRelayAddr])\n";
} else {
$hdr = "Received: from $Helo ([$RealRelayAddr])\n";
$hdr = "Received: from $Helo ([$RealRelayAddr])\n";
}
if($auth) {
$hdr .= "\tby $hn (envelope-sender $Sender) (MIMEDefang) with ESMTPA id $MsgID";
} else {
$hdr .= "\tby $hn (envelope-sender $Sender) (MIMEDefang) with ESMTP id $MsgID";
}
$hdr .= "\tby $hn (envelope-sender $Sender) (MIMEDefang) with ESMTP id $MsgID";
if ($#Recipients != 0) {
$hdr .= "; ";
$hdr .= "; ";
} else {
$hdr .= "\n\tfor " . $Recipients[0] . "; ";
$hdr .= "\n\tfor " . $Recipients[0] . "; ";
}

$hdr .= $strdate . "\n";
Expand Down

0 comments on commit 34ffd6f

Please sign in to comment.