Mailing List Archive

svn commit: r164821 - /spamassassin/branches/3.0/lib/Mail/SpamAssassin/PerMsgStatus.pm
Author: parker
Date: Tue Apr 26 09:44:54 2005
New Revision: 164821

URL: http://svn.apache.org/viewcvs?rev=164821&view=rev
Log:
Bug 3944: get_envelope_from not handling received header

Modified:
spamassassin/branches/3.0/lib/Mail/SpamAssassin/PerMsgStatus.pm

Modified: spamassassin/branches/3.0/lib/Mail/SpamAssassin/PerMsgStatus.pm
URL: http://svn.apache.org/viewcvs/spamassassin/branches/3.0/lib/Mail/SpamAssassin/PerMsgStatus.pm?rev=164821&r1=164820&r2=164821&view=diff
==============================================================================
--- spamassassin/branches/3.0/lib/Mail/SpamAssassin/PerMsgStatus.pm (original)
+++ spamassassin/branches/3.0/lib/Mail/SpamAssassin/PerMsgStatus.pm Tue Apr 26 09:44:54 2005
@@ -2539,6 +2539,23 @@

my $envf;

+ # use the "envelope-sender" string found in the Received headers,
+ # if possible... use the last untrusted header, in case there's
+ # trusted headers.
+ my $lasthop = $self->{relays_untrusted}->[0];
+ if (!defined $lasthop) {
+ # no untrusted headers? in that case, the message is ALL_TRUSTED.
+ # use the first trusted header (ie. the oldest, originating one).
+ $lasthop = $self->{relays_trusted}->[-1];
+ }
+
+ if (defined $lasthop) {
+ $envf = $lasthop->{envfrom};
+ if ($envf && ($envf =~ /\@/)) {
+ goto ok;
+ }
+ }
+
# Use the 'envelope-sender-header' header that the user has specified.
# We assume this is correct, *even* if the fetchmail/X-Sender screwup
# appears.