File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -238,6 +238,12 @@ sub LookupList {
238238
239239 # $ip1, $ip2, $ip3 all end in a trailing "."
240240
241+ # Precompute local part once
242+ my ($localpart ) = split /@/, $from ;
243+
244+ # Precompute bounce@*.subdomain patterns
245+ my @patterns = map { $localpart . ' @' . $_ } @subdomains ;
246+
241247 # It is in the list if either the exact address is listed,
242248 # the domain is listed,
243249 # the IP address is listed,
@@ -256,8 +262,9 @@ sub LookupList {
256262 return 1 if $BlackWhite -> {$i }{$ip1 };
257263 return 1 if $BlackWhite -> {$i }{$ip1c };
258264 return 1 if $BlackWhite -> {$i }{' default' };
259- foreach (@subdomains ) {
260- return 1 if $BlackWhite -> {$i }{$_ };
265+ foreach my $sub (@subdomains ) {
266+ return 1 if $BlackWhite -> {$i }{$sub }; # *.subdomain
267+ return 1 if $BlackWhite -> {$i }{$localpart .' @' .$sub }; # bounce@*.subdomain
261268 }
262269 }
263270
You can’t perform that action at this time.
0 commit comments