Skip to content

Commit

Permalink
Check and remove invalid chars from $rcptto (#691)
Browse files Browse the repository at this point in the history
* Check and remove invalid chars from $rcptto
  • Loading branch information
shawniverson authored Oct 12, 2024
1 parent 6a09777 commit b3431a4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.5.2-1
5.5.3-1
4 changes: 4 additions & 0 deletions changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
10/12/2024 Changes in v5.5.3-1
==================================
- Check for invalid chars in recipient address (msmilter) - Thanks to alexskynet

06/09/2024 Changes in v5.5.2-1
==================================
- Remove references to SORBS
Expand Down
8 changes: 7 additions & 1 deletion common/usr/sbin/MSMilter
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/perl -U -I /usr/share/MailScanner/perl

# (c) 2019-2020 MailScanner Project <https://www.mailscanner.info>
# Version 1.7
# Version 1.8
#
# 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
Expand Down Expand Up @@ -248,7 +248,13 @@ sub envrcpt_callback
${$message_ref} .= "\tby " . hostname . ' (MailScanner Milter) with SMTP id ';
}

# Check and remove invalid characters from rcptto
my $rcptto = $args[0];
$rcptto =~ s/^<//;
$rcptto =~ s/>$//;
$rcptto =~ s/<.*?>//g;
$rcptto = "<$rcptto>";

my $esmtpnotify = '';
# Capture the ESMTP options for pass through MailScanner engine
# RFC 3461
Expand Down

0 comments on commit b3431a4

Please sign in to comment.