multi-recipient-delimiter patch

Patrick Domack via amavis-users amavis-users at amavis.org
Wed Jan 29 04:36:31 CET 2014


Been working with postfix 2.11 that added support for multi  
recipient-delimiters. I also messed around with dovecot to make it  
function there also, and figured, I shouldn't leave amavis out of the  
loop. Here is a patch that I believe is fully functional to update  
it's support.


--- amavisd-new	2013-08-18 02:24:24.000000000 -0400
+++ amavisd-new	2014-01-28 22:20:22.487507619 -0500
@@ -4807,10 +4807,10 @@
    my $extension; local($1,$2);
    if ($localpart =~ /^(postmaster|mailer-daemon|double-bounce)\z/i) {
      # do not split these, regardless of what the delimiter is
-  } elsif ($delimiter eq '-' && $owner_request_special &&
+  } elsif (index($delimiter,'-')>=0 && $owner_request_special &&
             $localpart =~ /^owner-.|.-request\z/si) {
      # don't split owner-foo or foo-request
-  } elsif ($localpart =~ /^(.+?)(\Q$delimiter\E.*)\z/s) {
+  } elsif ($localpart =~ /^(.+?)([\Q$delimiter\E].*)\z/s) {
      ($localpart, $extension) = ($1, $2);  # extension includes a delimiter
      # do not split the address if the result would have a null localpart
    }
@@ -15112,7 +15112,7 @@
                                               
cr('addr_extension_maps_by_ccat'));
        my $ext = !ref($ext_map) ? undef : lookup2(0,$recip,$ext_map);
        if ($ext ne '') {
-        $ext = $delim . $ext;
+        $ext = substr($delim,0,1) . $ext;
          my $orig_extension;  my($localpart,$domain) = split_address($recip);
          ($localpart,$orig_extension) = split_localpart($localpart,$delim)
            if c('replace_existing_extension');  # strip existing extension




More information about the amavis-users mailing list