View Single Post
  #3  
Old 11th April 2011, 15:31
Scratchpad Scratchpad is offline
Junior Member
 
Join Date: Apr 2011
Posts: 8
Thanks: 0
Thanked 2 Times in 2 Posts
Default

I used Amavisd with ClamAV for my virus scanning and have it setup so that an email gets sent to virus-alert@example.com whenever a virus is detected.

I also use Amavisd with SpamAssassin to do the same thing for SPAM.

I believe it is the following line (for originating) and I think "originating" gets changed to something else for external mail (somebody correct me on this?) in /etc/amavisd.conf that you can configure where you want the email to go:

Code:
$policy_bank{'ORIGINATING'} = {  # mail supposedly originating from our users
  originating => 1,  # declare that mail was submitted by our smtp client
  allow_disclaimers => 1,  # enables disclaimer insertion if available
  # notify administrator of locally originating malware
  virus_admin_maps => ["virusalert\@$mydomain"],
  spam_admin_maps  => ["virusalert\@$mydomain"],
  warnbadhsender   => 1,
  # forward to a smtpd service providing DKIM signing service
  forward_method => 'smtp:[127.0.0.1]:10027',
  # force MTA conversion to 7-bit (e.g. before DKIM signing)
  smtpd_discard_ehlo_keywords => ['8BITMIME'],
  bypass_banned_checks_maps => [1],  # allow sending any file names and types
  terminate_dsn_on_notify_success => 0,  # don't remove NOTIFY=SUCCESS option
};
And then also in the same /etc/amavisd.conf:

Code:
$virus_admin               = "virusalert\@$mydomain";  # notifications recip.

$mailfrom_notify_admin     = "virusalert\@$mydomain";  # notifications sender
$mailfrom_notify_recip     = "virusalert\@$mydomain";  # notifications sender
$mailfrom_notify_spamadmin = "spam.police\@$mydomain"; # notifications sender
$mailfrom_to_quarantine = ''; # null return path; uses original sender if undef
then again within the same config file:

Code:
$final_virus_destiny      = D_DISCARD;
$final_banned_destiny     = D_REJECT;
$final_spam_destiny       = D_BOUNCE;
$final_bad_header_destiny = D_PASS;
Make sure you change the settings to your particular needs. The above is from my test linux box so they are NOT tweaked for production use obviously.

If you don't have Amavisd running, check out any of the "Perfect Setup" tutorials on this site. There is pretty much one for every OS ... the guys are amazing!
Reply With Quote