Best strategy to debug recipient domains?

Mark Martinec Mark.Martinec+amavis at ijs.si
Mon Apr 11 16:23:22 CEST 2011


Parick,

> I need to debug messages sent to one out of ~ 500 domains (all in
> @local_domains_maps). What would be the best strategy to debug that
> particular recipient domain without bloating the log with all others debug
> output?
> 
> Would something like debug_recipient_maps make sense?

Makes sense.

Here is a patch against 2.7.0-pre14:

--- amavisd.orig	2011-02-02 22:11:30.000000000 +0100
+++ amavisd	2011-04-11 16:20:50.872382266 +0200
@@ -334,5 +334,5 @@
       @whitelist_sender_maps @blacklist_sender_maps @score_sender_maps
       @author_to_policy_bank_maps @signer_reputation_maps
-      @message_size_limit_maps @debug_sender_maps
+      @message_size_limit_maps @debug_sender_maps @debug_recipient_maps
       @bypass_virus_checks_maps @bypass_spam_checks_maps
       @bypass_banned_checks_maps @bypass_header_checks_maps
@@ -1911,5 +1911,5 @@
     @whitelist_sender_maps @blacklist_sender_maps @score_sender_maps
     @author_to_policy_bank_maps @signer_reputation_maps
-    @message_size_limit_maps @debug_sender_maps
+    @message_size_limit_maps @debug_sender_maps @debug_recipient_maps
     @bypass_virus_checks_maps @bypass_spam_checks_maps
     @bypass_banned_checks_maps @bypass_header_checks_maps
@@ -17690,5 +17690,11 @@
       $msginfo->originating(c('originating')); # may have changed by a p.b.load
     }
-    debug_oneshot(1)  if lookup2(0,$sender, ca('debug_sender_maps'));
+    my $debsendrm = ca('debug_sender_maps');
+    my $debrecipm = ca('debug_recipient_maps');
+    if (@$debsendrm && lookup2(0, $sender, $debsendrm) ||
+        @$debrecipm && grep(lookup2(0, $_->recip_addr, $debrecipm),
+                                    @{$msginfo->per_recip_data})) {
+      debug_oneshot(1);
+    }
     # check_mail() expects open file on $fh, need not be rewound
     Amavis::check_mail_begin_task();
@@ -18633,4 +18639,7 @@
           $orcpt = orcpt_encode($addr)  if !defined $orcpt;
         }
+        debug_oneshot(
+          lookup2(0,$addr_unq, ca('debug_recipient_maps')) ? 1 : 0,
+          $self->{proto} . "< $cmd");
         my($recip_size_limit); my($mslm) = ca('message_size_limit_maps');
         $recip_size_limit = lookup2(0,$addr_unq,$mslm)  if @$mslm;



Mark


More information about the amavis-users mailing list