Skip to content

Commit

Permalink
Check for bad helo callback (#671)
Browse files Browse the repository at this point in the history
* Check for unexpected helo callback
  • Loading branch information
shawniverson authored Oct 22, 2023
1 parent cd8db1f commit 785ef5c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions common/usr/sbin/MSMilter
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ sub helo_callback
my $helohost = shift;
my $message_ref = $ctx->getpriv();
my $message = "Received: from $helohost";
# 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;
}
# Watch for the second callback
if ( ${$message_ref} !~ /^Received:/ ) {
${$message_ref} = $message . ' (' . ${$message_ref} . ')' ."\n";
Expand Down

0 comments on commit 785ef5c

Please sign in to comment.