Detect sender on first instance only (#524)

This commit is contained in:
Shawn Iverson 2021-01-10 06:09:24 -05:00 committed by GitHub
parent a0230c3b85
commit 3482eb02c6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -897,6 +897,7 @@ sub new {
my($line);
my @recipient;
my $recipientfound = 0;
my $senderfound = 0;
my $permfail = 0;
my($sender);
my $opts = '';
@ -948,6 +949,7 @@ sub new {
next;
}
$recipientfound = 0;
$senderfound = 0;
# Read in pre-data header
my $msgstart = 0;
while(!eof($queuehandle)) {
@ -960,9 +962,10 @@ sub new {
MailScanner::Log::DebugLog("MSMail: KickMessage: recipient = $line");
$msgstart = tell $queuehandle;
next;
} elsif ($line =~ /^S/) {
} elsif ($line =~ /^S/ && $senderfound == 0) {
$line =~ s/^S//;
$sender = $line;
$senderfound = 1;
MailScanner::Log::DebugLog("MSMail: KickMessage: sender = $sender");
$msgstart = tell $queuehandle;
} elsif ($line =~ /^E</) {