1

Topic: Disable notification mails for quarantined mails

==== Required information ====
- iRedMail version: 0.8.7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): LDAP
- Linux/BSD distribution name and version: Ubuntu 12.04.4 LTS
- Related log if you're reporting an issue:
====

Is there a possibility to turn off the notification mails (e.g. BANNED contents(.exe,report_id.....))?
I've already seen that the recipient can be configured in the amavis configuration, but I'm looking for a way to completely turn those notifications off.

2

Re: Disable notification mails for quarantined mails

Try this:

*) Search 'spam_admin_maps' in Amavisd config files under /etc/amavis/conf.d/*
*) Set it to empty list or comment out it, then restart Amavisd service.

3

Re: Disable notification mails for quarantined mails

Hey,

still mails incoming (they are sent to 'root').
Any other ideas?

Thanks in advance.

Best,
Achim

4

Re: Disable notification mails for quarantined mails

Did you comment out 'spam_admin_maps' in Amavisd config file?

5

Re: Disable notification mails for quarantined mails

yep,

    #spam_admin_maps  => ["root\@$mydomain"],
    spam_admin_maps  => [],

6

Re: Disable notification mails for quarantined mails

Did you comment out other *_admin_maps in Amavisd config file?

virus_admin_maps => ["root\@\$mydomain"],                                     
    spam_admin_maps  => [],                                                       
    bad_header_admin_maps => [],                                                                                   
    banned_admin_maps => [],

7

Re: Disable notification mails for quarantined mails

ZhangHuangbin wrote:

Did you comment out other *_admin_maps in Amavisd config file?

root@mail:/etc/amavis/conf.d# pwd
/etc/amavis/conf.d

root@mail:/etc/amavis/conf.d# grep _admin_maps *
50-user:  # virus_admin_maps => ["root\@$mydomain"],
50-user:  virus_admin_maps => [],
50-user:  #spam_admin_maps  => ["root\@$mydomain"],
50-user:  spam_admin_maps  => [],
50-user:    # virus_admin_maps => ["root\@$mydomain"],
50-user:    virus_admin_maps => [],
50-user:    #spam_admin_maps  => ["root\@$mydomain"],
50-user:    spam_admin_maps  => [],

all found maps are empty.

8

Re: Disable notification mails for quarantined mails

Please add bad_header_admin_maps and banned_admin_maps manually.

9

Re: Disable notification mails for quarantined mails

grep _admin_maps *
50-user:  # virus_admin_maps => ["root\@$mydomain"],
50-user:  virus_admin_maps => [],
50-user:  #spam_admin_maps  => ["root\@$mydomain"],
50-user:  spam_admin_maps  => [],
50-user:  banned_admin_maps => [],
50-user:  bad_header_admin_maps => [],
50-user:    # virus_admin_maps => ["root\@$mydomain"],
50-user:    virus_admin_maps => [],
50-user:    #spam_admin_maps  => ["root\@$mydomain"],
50-user:    spam_admin_maps  => [],
50-user:    bad_header_admin_maps => [],
50-user:    banned_admin_maps => [],

Did it, but unfortunately still mails incoming.

10

Re: Disable notification mails for quarantined mails

Could you please paste one of this email? And full content of file 50-user (remove SQL/LDAP password in this file before pasting)?

11

Re: Disable notification mails for quarantined mails

No problem.

E-Mail:
http://i.imgur.com/J5bMVm6.png

50-user:

use strict;

#
# Place your configuration directives here.  They will override those in
# earlier files.
#
# See /usr/share/doc/amavisd-new/ for documentation and examples of
# the directives you can use in this file
#


#------------ Do not modify anything below this line -------------
#{1}


chomp($mydomain = "");
@local_domains_maps = [];
@mynetworks = qw( 127.0.0.0/8 [::1] [FE80::]/10 [FEC0::]/10
                  10.0.0.0/8 172.16.0.0/12 192.168.0.0/16 );

# listen on multiple TCP ports. 9998 is used for releasing quarantined mails.
$inet_socket_port = [10024, 9998,];

# Enable virus check.
@bypass_virus_checks_maps = (
   \%bypass_virus_checks,
   \@bypass_virus_checks_acl,
   $bypass_virus_checks_re,
   );

# Enable spam check.
@bypass_spam_checks_maps = (
    \%bypass_spam_checks,
    \@bypass_spam_checks_acl,
    $bypass_spam_checks_re,
    );

$virus_admin = "root\@$mydomain"; # due to D_DISCARD default
$mailfrom_notify_admin = "root\@$mydomain";
$mailfrom_notify_recip = "root\@$mydomain";
$mailfrom_notify_spamadmin = "root\@$mydomain";

# Mail notify.
$mailfrom_notify_admin     = "root\@$mydomain";  # notifications sender
$mailfrom_notify_recip     = "root\@$mydomain";  # notifications sender
$mailfrom_notify_spamadmin = "root\@$mydomain"; # notifications sender
$mailfrom_to_quarantine = ''; # null return path; uses original sender if undef

# Disable defang banned mail.
$defang_banned = 0;  # MIME-wrap passed mail containing banned name

$policy_bank{'MYNETS'} = {   # mail originating from @mynetworks
  originating => 1,  # is true in MYNETS by default, but let's make it explicit
  os_fingerprint_method => undef,  # don't query p0f for internal clients
  allow_disclaimers => 1,  # enables disclaimer insertion if available
};

$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
  virus_admin_maps => [],
  spam_admin_maps  => [],
  banned_admin_maps => [],
  bad_header_admin_maps => [],
  warnbadhsender   => 0,
  warnvirussender  => 0,
  warnspamsender   => 0,
  # forward to a smtpd service providing DKIM signing service
  #forward_method => 'smtp:[amavis]: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
};

# SpamAssassin debugging. Default if off(0).
# Note: '$log_level' variable above is required for SA debug.
$log_level = 0;              # verbosity 0..5, -d
$sa_debug = 0;

# Set hostname.
$myhostname = "mail.xxxxxxx.xxx";

# Set listen IP/PORT.
$notify_method  = 'smtp:[127.0.0.1]:10025';
$forward_method = 'smtp:[127.0.0.1]:10025';

# Set default action.
# Available actions: D_PASS, D_BOUNCE, D_REJECT, D_DISCARD.
$final_virus_destiny      = D_DISCARD;
## $final_banned_destiny     = D_PASS;
$final_banned_destiny     = D_DISCARD;
## $final_spam_destiny       = D_PASS;
$final_spam_destiny       = D_DISCARD;
$final_bad_header_destiny = D_PASS;

@av_scanners = (

    #### http://www.clamav.net/
    ['ClamAV-clamd',
    \&ask_daemon, ["CONTSCAN {}\n", "/tmp/clamd.socket"],
    qr/\bOK$/, qr/\bFOUND$/,
    qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],
);

@av_scanners_backup = (

    ### http://www.clamav.net/   - backs up clamd or Mail::ClamAV
    ['ClamAV-clamscan', 'clamscan',
    "--stdout --disable-summary -r --tempdir=$TEMPBASE {}", [0], [1],
    qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],
);

$policy_bank{'MYUSERS'} = {
    # declare that mail was submitted by our smtp client
    originating => 1,

    # enables disclaimer insertion if available
    allow_disclaimers => 1,

    # notify administrator of locally originating malware
    virus_admin_maps => [],
    spam_admin_maps  => [],
    bad_header_admin_maps => [],
    banned_admin_maps => [],
    warnbadhsender   => 0,

    # 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'],

    # don't remove NOTIFY=SUCCESS option
    terminate_dsn_on_notify_success => 0,

    # don't perform spam/virus/header check.
    #bypass_spam_checks_maps => [1],
    #bypass_virus_checks_maps => [1],
    #bypass_header_checks_maps => [1],

    # allow sending any file names and types
    #bypass_banned_checks_maps => [1],
};

# regular incoming mail, originating from anywhere (usually from outside)
#$policy_bank{'EXT'} = {
#  # just use global settings, no special overrides
#};

#
# Port used to release quarantined mails.
#
$interface_policy{'9998'} = 'AM.PDP-INET';
$policy_bank{'AM.PDP-INET'} = {
    protocol => 'AM.PDP',       # select Amavis policy delegation protocol
    inet_acl => [qw( 127.0.0.1 [::1] )],    # restrict access to these IP addresses
    auth_required_release => 1,    # 0 - don't require secret_id for amavisd-release
    #log_level => 4,
    #always_bcc_by_ccat => {CC_CLEAN, 'admin@example.com'},
};

#########################
# Quarantine mails.
#

# Don't quarantine mails with bad header.
$bad_header_quarantine_method = undef;

# Quarantine SPAM.
$spam_quarantine_to = 'spam-quarantine';

# Quarantine method. How to store mail body.
#   - 'local:spam-%i-%m', store mail on local file system.
#   - 'sql:', store mail body in MySQL.
$spam_quarantine_method = 'sql:';

#########################
# Quarantine VIRUS mails.
#
$virus_quarantine_to     = 'virus-quarantine';
$virus_quarantine_method = 'sql:';

#########################
# Quarantine BANNED mails.
#
$banned_files_quarantine_method = 'sql:';
$banned_quarantine_to = 'banned-quarantine';


# Modify email subject, add '$sa_spam_subject_tag'.
#   0:  disable
#   1:  enable
$sa_spam_modifies_subj = 1;

# remove existing headers
#$remove_existing_x_scanned_headers= 0;
#$remove_existing_spam_headers = 0;

# Leave empty (undef) to add no header.
# Modify /usr/sbin/amavisd or /usr/sbin/amavisd-new file to add customize header in:
#
#   sub add_forwarding_header_edits_per_recip
#
#$X_HEADER_TAG = 'X-Virus-Scanned';
#$X_HEADER_LINE = "by amavisd at $myhostname";

# Notify virus sender?
#$warnvirussender = 0;

# Notify spam sender?
#$warnspamsender = 0;

# Notify sender of banned files?
$warnbannedsender = 0;

# Notify sender of syntactically invalid header containing non-ASCII characters?
$warnbadhsender = 0;

# Notify virus (or banned files) RECIPIENT?
#  (not very useful, but some policies demand it)
$warnvirusrecip = 0;
$warnbannedrecip = 0;

# Notify also non-local virus/banned recipients if $warn*recip is true?
#  (including those not matching local_domains*)
$warn_offsite = 0;

#$notify_sender_templ      = read_text('/var/amavis/notify_sender.txt');
#$notify_virus_sender_templ= read_text('/var/amavis/notify_virus_sender.txt');
#$notify_virus_admin_templ = read_text('/var/amavis/notify_virus_admin.txt');
#$notify_virus_recips_templ= read_text('/var/amavis/notify_virus_recips.txt');
#$notify_spam_sender_templ = read_text('/var/amavis/notify_spam_sender.txt');
#$notify_spam_admin_templ  = read_text('/var/amavis/notify_spam_admin.txt');

$sql_allow_8bit_address = 1;
$timestamp_fmt_mysql = 1;

# a string to prepend to Subject (for local recipients only) if mail could
# not be decoded or checked entirely, e.g. due to password-protected archives
#$undecipherable_subject_tag = '***UNCHECKED*** ';  # undef disables it
$undecipherable_subject_tag = undef;
# Hope to fix 'nested MAIL command' issue on high load server.
$smtp_connection_cache_enable = 0;

# The default set of header fields to be signed can be controlled
# by setting %signed_header_fields elements to true (to sign) or
# to false (not to sign). Keys must be in lowercase, e.g.:
# 0 -> off
# 1 -> on
$signed_header_fields{'received'} = 0;
$signed_header_fields{'to'} = 1;

# Make sure it sings all inbound mails, avoid error log like this:
# 'dkim: not signing inbound mail'.
$originating = 1;

# Add dkim_key here.
dkim_key("xxxxx.xxx", "dkim", "/var/lib/dkim/xxxxxx.xxx.pem");



@dkim_signature_options_bysender_maps = ( {
    # ------------------------------------
    # For domain: xxxxxxx.xxx.
    # ------------------------------------
    # 'd' defaults to a domain of an author/sender address,
    # 's' defaults to whatever selector is offered by a matching key

    #'postmaster@xxxxxxx.xxx'    => { d => "xxxxxxx.xxx", a => 'rsa-sha256', ttl =>  7*24*3600 },
    #"spam-reporter@xxxxxxx.xxx"    => { d => "xxxxxxx.xxx", a => 'rsa-sha256', ttl =>  7*24*3600 },

    # explicit 'd' forces a third-party signature on foreign (hosted) domains
    "xxxxx.xxx"  => { d => "xxxxxxx.xxx", a => 'rsa-sha256', ttl => 10*24*3600 },
    # ---- End domain: xxxxxxx.xxx ----

    # catchall defaults
    '.' => { a => 'rsa-sha256', c => 'relaxed/simple', ttl => 30*24*3600 },
} );
$enable_dkim_verification = 1;  # enable DKIM signatures verification
$enable_dkim_signing = 1;    # load DKIM signing code, keys defined by dkim_key
# ------------ Disclaimer Setting ---------------
# Uncomment this line to enable singing disclaimer in outgoing mails.
#$defang_maps_by_ccat{+CC_CATCHALL} = [ 'disclaimer' ];

# Program used to signing disclaimer in outgoing mails.
$altermime = '/usr/bin/altermime';

# Disclaimer in plain text formart.
@altermime_args_disclaimer = qw(--disclaimer=/etc/postfix/disclaimer/_OPTION_.txt --disclaimer-html=/etc/postfix/disclaimer/_OPTION_.txt --force-for-bad-html);

@disclaimer_options_bysender_maps = ({
    # Per-domain disclaimer setting: /etc/postfix/disclaimer/host1.iredmail.org.txt
    #'host1.iredmail.org' => 'host1.iredmail.org',

    # Sub-domain disclaimer setting: /etc/postfix/disclaimer/iredmail.org.txt
    #'.iredmail.org'      => 'iredmail.org',

    # Per-user disclaimer setting: /etc/postfix/disclaimer/boss.iredmail.org.txt
    #'boss@iredmail.org'  => 'boss.iredmail.org',

    # Catch-all disclaimer setting: /etc/postfix/disclaimer/default.txt
    '.' => 'default',
},);
# ------------ End Disclaimer Setting ---------------
# Integrate Amavisd-new with OpenLDAP.
$enable_ldap    = 1;    # 1 -> enable, 0 -> disable.
$default_ldap   = {
    hostname        => "127.0.0.1",
    port            => 389,
    version         => 3,
    tls             => 0,
    timeout         => 120,
    base            => "o=domains,dc=xxxxxxxxx,dc=xxx",
    scope           => "sub",
    query_filter    => "(&(objectClass=mailUser)(objectClass=amavisAccount)(accountStatus=active)(|(mail=%m)(shadowAddress=%m)))",
    bind_dn         => "cn=vmail,dc=xxxxxxxxxx,dc=xxx",
    bind_password   => "xxx",
};
@storage_sql_dsn = (
    ['DBI:mysql:database=amavisd;host=127.0.0.1;port=3306', 'amavisd', 'xxx'],
);
#@lookup_sql_dsn = @storage_sql_dsn;

1;  # insure a defined return

12

Re: Disable notification mails for quarantined mails

no idea?

best,
achim

13

Re: Disable notification mails for quarantined mails

Does it work if you add two more options inside all '$policy_bank' blocks?

warnbannedrecip = 0,
warnbannedsender =0,

14

Re: Disable notification mails for quarantined mails

Unfortunately not.

Best,
Achim

15

Re: Disable notification mails for quarantined mails

No idea yet. It's better to ask in Amavisd mailing list.