mirror of
https://github.com/MailScanner/v5.git
synced 2024-11-10 09:13:31 +08:00
Check for empty queue id (#368)
This commit is contained in:
parent
9ddb121861
commit
8a419c96d6
1 changed files with 15 additions and 3 deletions
|
@ -1,7 +1,7 @@
|
|||
#!/usr/bin/perl -U -I /usr/share/MailScanner/perl
|
||||
|
||||
# (c) 2018 MailScanner Project <https://www.mailscanner.info>
|
||||
# Version 1.3
|
||||
# (c) 2019 MailScanner Project <https://www.mailscanner.info>
|
||||
# Version 1.4
|
||||
#
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
|
@ -268,7 +268,12 @@ sub header_callback
|
|||
if (${$message_ref} =~ /SMTP\sid\s$/ ) {
|
||||
if (defined($symbols->{'L'}) && defined($symbols->{'L'}->{'i'}) ) {
|
||||
$id = $symbols->{'L'}->{'i'};
|
||||
MailScanner::Log::DebugLog("Postfix ID captured: $id");
|
||||
if ( $id ne '' ) {
|
||||
MailScanner::Log::DebugLog("Postfix ID captured: $id");
|
||||
} else {
|
||||
$id = smtp_id;
|
||||
MailScanner::Log::DebugLog("Postfix id empty, generated one instead: $id");
|
||||
}
|
||||
} else {
|
||||
$id = smtp_id;
|
||||
MailScanner::Log::DebugLog("Unable to capture real postfix id, generated one instead: $id");
|
||||
|
@ -339,6 +344,13 @@ sub eoh_callback
|
|||
}
|
||||
}
|
||||
|
||||
if ( $id eq '' ) {
|
||||
# Missing a queue id, header_callback possibly skipped, reject
|
||||
MailScanner::Log::WarnLog("Postfix queue id is missing");
|
||||
Sendmail::PMilter::SMFIS_TEMPFAIL;
|
||||
return;
|
||||
}
|
||||
|
||||
# Write header to file
|
||||
my $queuehandle = new FileHandle;
|
||||
my $incoming = MailScanner::Config::Value('inqueuedir');
|
||||
|
|
Loading…
Reference in a new issue