Relaydelay patch

After I don't know how many years using and coding on Evan Harris's relaydelay Sendmail milter, I just recently found and fixed a small bug in the recipient whitelisting code on version 0.04. Prior to this fix, recipient whitelisting wouldn't work if the database entry for the address wasn't enclosed in <> brackets. This was due to the way that the rcpt_to variable was handled prior to the database call. T

After I don't know how many years using and coding on Evan Harris's relaydelay Sendmail milter, I just recently found and fixed a small bug in the recipient whitelisting code on version 0.04. Prior to this fix, recipient whitelisting wouldn't work if the database entry for the address wasn't enclosed in <> brackets. This was due to the way that the rcpt_to variable was handled prior to the database call. The patch below yanks those out of the string if they exist, rendering normal addresses viable for recipient whitelisting.

Note that this patch was made against a heavily modified milter, so it might fail on the stock version. Just add the regex in the patch in the right place in your version.

--- relaydelay.rcpt_to.pl Sat Aug 5 12:27:25 2006

+++ relaydelay.pl Thu Aug 3 10:18:41 2006

@@ -743,6 +743,7 @@

# See if this recipient (or domain/subdomain) is wildcard white/blacklisted

# Do the check in such a way that more exact matches are returned first

if ($check_wildcard_rcpt_to) {

+ $rcpt_to =~ s/(?:<|>)//g;

my $subquery = "rcpt_to = " . $dbh->quote($rcpt_to);

my $tstr = $rcpt_domain;

while(index($tstr, ".") > 0) {

Join the discussion
Be the first to comment on this article. Our Commenting Policies