Skip to content

Commit

Permalink
Add values to return statements. (#683)
Browse files Browse the repository at this point in the history
  • Loading branch information
msapiro authored Feb 18, 2024
1 parent e8f8783 commit 79c5ef5
Showing 1 changed file with 10 additions and 20 deletions.
30 changes: 10 additions & 20 deletions common/usr/sbin/MSMilter
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,7 @@ sub helo_callback
# Check for unexpected helo
if ( ${$message_ref} =~ /^[0-9A-F]{7,20}|[0-9B-DF-HJ-NP-TV-Zb-df-hj-np-tv-z]{8,20}$/) {
MailScanner::Log::WarnLog("Unexpected helo callback");
Sendmail::PMilter::SMFIS_TEMPFAIL;
return;
return Sendmail::PMilter::SMFIS_TEMPFAIL;
}
# Watch for the second callback
if ( ${$message_ref} !~ /^Received:/ ) {
Expand Down Expand Up @@ -194,8 +193,7 @@ sub envrcpt_callback
MailScanner::Log::DebugLog("envrcpt_callback: incoming = " . @{$incoming}[0]);
if ($incoming eq '') {
MailScanner::Log::WarnLog("Unable to determine incoming queue!");
Sendmail::PMilter::SMFIS_TEMPFAIL;
return;
return Sendmail::PMilter::SMFIS_TEMPFAIL;
}
my $file = @{$incoming}[0] . '/temp-' . ${$message_ref};

Expand All @@ -205,8 +203,7 @@ sub envrcpt_callback
$ret = MailScanner::Lock::openlock($queuehandle,'+<' . $file, 'w');
if ($ret != 1) {
MailScanner::Log::WarnLog("Unable to to open temp queue file for reading!");
Sendmail::PMilter::SMFIS_TEMPFAIL;
return;
return Sendmail::PMilter::SMFIS_TEMPFAIL;
}

my $data;
Expand Down Expand Up @@ -373,8 +370,7 @@ 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;
return Sendmail::PMilter::SMFIS_TEMPFAIL;
}

# Write header to file
Expand All @@ -383,8 +379,7 @@ sub eoh_callback
MailScanner::Log::DebugLog("eoh_callback: incoming = " . @{$incoming}[0]);
if ($incoming eq '') {
MailScanner::Log::WarnLog("Unable to determine incoming queue!");
Sendmail::PMilter::SMFIS_TEMPFAIL;
return;
return Sendmail::PMilter::SMFIS_TEMPFAIL;
}
my $file = @{$incoming}[0] . '/temp-' . $id;

Expand All @@ -394,8 +389,7 @@ sub eoh_callback
$ret = MailScanner::Lock::openlock($queuehandle,'>>' . $file, 'w');
if ($ret != 1) {
MailScanner::Log::WarnLog("Unable to to open queue temp file for writing!");
Sendmail::PMilter::SMFIS_TEMPFAIL;
return;
return Sendmail::PMilter::SMFIS_TEMPFAIL;
}

$queuehandle->print(${$message_ref});
Expand Down Expand Up @@ -484,8 +478,7 @@ sub body_callback
MailScanner::Log::DebugLog("body_callback: incoming = " . @{$incoming}[0]);
if ($incoming eq '') {
MailScanner::Log::WarnLog("Unable to determine incoming queue!");
Sendmail::PMilter::SMFIS_TEMPFAIL;
return;
return Sendmail::PMilter::SMFIS_TEMPFAIL;
}
my $file = @{$incoming}[0] . '/temp-' . ${$message_ref};

Expand All @@ -495,8 +488,7 @@ sub body_callback
$ret = MailScanner::Lock::openlock($queuehandle,'>>' . $file, 'w');
if ($ret != 1) {
MailScanner::Log::WarnLog("Unable to to open queue temp file for writing!");
Sendmail::PMilter::SMFIS_TEMPFAIL;
return;
return Sendmail::PMilter::SMFIS_TEMPFAIL;
}
$queuehandle->print($body_chunk);

Expand All @@ -520,8 +512,7 @@ sub eom_callback
MailScanner::Log::DebugLog("eom_callback: incoming = " . @{$incoming}[0]);
if ($incoming eq '') {
MailScanner::Log::WarnLog("Unable to determine incoming queue!");
Sendmail::PMilter::SMFIS_TEMPFAIL;
return;
return Sendmail::PMilter::SMFIS_TEMPFAIL;
}

my $file = @{$incoming}[0] . '/temp-' . ${$message_ref};
Expand All @@ -548,8 +539,7 @@ sub close_callback
MailScanner::Log::DebugLog("eom_callback: incoming = " . @{$incoming}[0]);
if ($incoming eq '') {
MailScanner::Log::WarnLog("Unable to determine incoming queue!");
Sendmail::PMilter::SMFIS_TEMPFAIL;
return;
return Sendmail::PMilter::SMFIS_TEMPFAIL;
}
my $file = @{$incoming}[0] . '/temp-' . ${$message_ref};

Expand Down

0 comments on commit 79c5ef5

Please sign in to comment.