diff -r -u -N amavisd-snapshot-20010407.orig/amavis/amavisd.conf.in amavisd-snapshot-20010407/amavis/amavisd.conf.in --- amavisd-snapshot-20010407.orig/amavis/amavisd.conf.in Fri Mar 16 11:11:11 2001 +++ amavisd-snapshot-20010407/amavis/amavisd.conf.in Tue Jun 12 13:03:36 2001 @@ -145,3 +145,16 @@ # Display AMaViS credits to users $credits = "no"; +# Send notifications of rejected emails to recipients +# only if the recipients are in a domain we control? +# This is mostly useful for us to find out when a client +# or other business party tried to send us an infected +# or otherwise suspicious email message, so that we can +# call them and let them know they have a problem. +$notify_recipients_here_only = "yes"; + +# A list of domains which compose "here". +# (i.e., the domains for which we'll sent notices to +# recipients) +# This is a standard perl @array. +@notify_here_domains = ( "yourrealdomain.com" ,"somevirtualdomain.com" ); diff -r -u -N amavisd-snapshot-20010407.orig/amavis/amavisd.in amavisd-snapshot-20010407/amavis/amavisd.in --- amavisd-snapshot-20010407.orig/amavis/amavisd.in Thu Apr 5 12:19:32 2001 +++ amavisd-snapshot-20010407/amavis/amavisd.in Tue Jun 12 13:02:44 2001 @@ -114,6 +114,11 @@ use vars qw ( $SENDER @RECIPS $LDA @LDAARGS ); use vars qw ( $sendmail_wrapper $sendmail_wrapper_args $mailfrom $mailto ); +# HACKALERT +# Hacks to the warn_recip() code to only notify the recipients if +# they are in one of our domains +use vars qw ( $notify_recipients_here_only @notify_here_domains ); + # Temporary directory # Moved this above MTA init section because milter init sets TEMPDIR my $TEMPBASE = "@runtime_dir@"; @@ -432,10 +437,40 @@ # # Notify recipient(s) sub warn_recip() { - foreach (@RECIPS) { - open(MAIL, "|$sendmail_wrapper $sendmail_wrapper_args -f$mailfrom") || do_exit($REGERR, __LINE__);@warn_recip_frag@ - close(MAIL); + + # HACKALERT + # This code is for the "only notify recipients of my local domains" + # hack... if it's enabled ($notify_recipients_here_only = "yes"), + # then we'll only send out a warning to the recipients if all + # of the recipients are in a domain listed in @notify_here_domains. + + my $dowarn = "yes"; + my $local_recipcount = 0; + my ($recip, $domain); + + if ($notify_recipients_here_only eq "yes") { + foreach $recip (@RECIPS) { + foreach $domain (@notify_here_domains) { + if ( $recip =~ /$domain/i ) { + $local_recipcount++; + last; + } + } + } + $dowarn = "no" if ($local_recipcount < @RECIPS); + } + + if ($dowarn eq "yes") { + + # Here is the original code for this sub... + foreach (@RECIPS) { + open(MAIL, "|$sendmail_wrapper $sendmail_wrapper_args -f$mailfrom") || do_exit($REGERR, __LINE__); + @warn_recip_frag@ + close(MAIL); + } + } + } #