Patch for only adding domain disclaimers to external recipients

Mark Martinec via amavis-users amavis-users at amavis.org
Tue May 6 16:44:19 CEST 2014


Quanah,

> We had a request from one of our clients that disclaimers only be
> attached to emails that are outbound (i.e., not attach it to email
> being delivered to local users).  This is the patch that I came up
> with.  Mark, does it look valid to you?  Is there a better method for
> this?
> -      $file $altermime $enable_anomy_sanitizer
> +      $file $altermime $enable_anomy_sanitizer 
> $external_disclaimer_only
> [...]

Thank you, makes sense, will add the following to the final 2.9.0:

--- amavisd~    2014-05-06 16:33:52.033527057 +0200
+++ amavisd     2014-05-06 16:41:07.271496342 +0200
@@ -315,5 +315,5 @@
        $recipient_delimiter $replace_existing_extension
        $hdr_encoding $bdy_encoding $hdr_encoding_qb
-      $allow_disclaimers
+      $allow_disclaimers $outbound_disclaimers_only
        $prepend_header_fields_hdridx
        $allow_fixing_improper_header
@@ -13865,4 +13865,7 @@
                  $to_be_mangled = 0;  # not for foreign 'Sender:' or 
'From:'
                  do_log(5,"will not add disclaimer, sender not local");
+              } elsif (c('outbound_disclaimers_only') && 
$r->recip_is_local) {
+                $to_be_mangled = 0;
+                do_log(5, "will not add disclaimer, recipient is 
local");
                }
              }


Mark


More information about the amavis-users mailing list