目前按官網文檔設定如下
1).#/etc/amavisd/amavisd.conf
#Quarantining” 使用
$final_virus_destiny = D_DISCARD;
$final_banned_destiny = D_DISCARD;
$final_spam_destiny = D_DISCARD;
$final_bad_header_destiny = D_DISCARD;
$bad_header_quarantine_method = 'sql:';
$bad_header_quarantine_to = 'bad-header-quarantine';
$spam_quarantine_method = 'sql:';
$spam_quarantine_to = 'spam-quarantine';
$virus_quarantine_to = 'virus-quarantine';
$virus_quarantine_method = 'sql:';
$banned_files_quarantine_method = 'sql:';
$banned_quarantine_to = 'banned-quarantine';
$clean_quarantine_method = 'sql:';
#下面Quarantine clean emails sent from/to certain local user ” 使用
$clean_quarantine_to = 'clean-quarantine';
$inet_socket_port = [10024, 11026, 9998,12030];
#Quarantine clean emails
$interface_policy{'12030'} = 'QUARANTINE';
$policy_bank{'QUARANTINE'} = {
#是否重複下面?
clean_quarantine_method => 'sql:',
final_destiny_maps_by_ccat => {CC_CLEAN, D_DISCARD},
};
$interface_policy{'11026'} = 'ORIGINATING';
$policy_bank{'ORIGINATING'} = {
originating => 1,
allow_disclaimers => 1,
virus_admin_maps => ["spam\@l.domain1.com"],
spam_admin_maps => ["spam\@l.domain1.com"],
warnbadhsender => 1,
smtpd_discard_ehlo_keywords => ['8BITMIME'],
bypass_banned_checks_maps => [1],
terminate_dsn_on_notify_success => 0,
#是否重複上面?
clean_quarantine_method => 'sql:',
final_destiny_by_ccat => {CC_CLEAN, D_DISCARD},
};
@storage_sql_dsn = (
['DBI:mysql:database=amavisd;host=127.0.0.1;port=3306', 'amavisd', 'xxxxxxxxxxxxxxxxxxx'],
##11026Quarantine clean emails sent from/to certain local user 使用
['DBI:mysql:database=amavisd;host=127.0.0.1;port=3306', 'test2@l.domain1.com', 'abcdefghijkl'], # 密碼為12碼明文 正確?
);
##########################
2)//var/www/iredadmin/settings.py.
#Quarantining” 使用
amavisd_enable_logging = True
amavisd_enable_quarantine = True
amavisd_quarantine_port = "9998"
amavisd_enable_policy_lookup = True
amavisd_db_host = "127.0.0.1"
amavisd_db_port = "3306"
amavisd_db_name = "amavisd"
amavisd_db_user = "amavisd"
amavisd_db_password = "xxxxxxxxxxxxxxxxxxx"
########################
3)./etc/postfix/master.cf
#Quarantine clean emails sent from/to certain local user ” 使用
submission inet n - n - - smtpd
-o syslog_name=submission(587)
-o smtpd_tls_security_level=encrypt
-o smtpd_sasl_auth_enable=yes
-o smtpd_client_restrictions=permit_mynetworks,permit_sasl_authenticated,reject
-o content_filter=smtp-amavis:[127.0.0.1]:11026
127.0.0.1:12027 inet n - n - - smtpd
-o content_filter=smtp-amavis:[127.0.0.1]:12030
-o recipient_bcc_maps=
-o sender_bcc_maps= -o mynetworks_style=host -o mynetworks=127.0.0.0/8
-o local_recipient_maps= -o relay_recipient_maps=
-o strict_rfc821_envelopes=yes -o smtp_tls_security_level=none
-o smtpd_tls_security_level=none -o smtpd_restriction_classes=
-o smtpd_delay_reject=no
-o smtpd_client_restrictions=permit_mynetworks,reject
-o smtpd_helo_restrictions= -o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject
-o smtpd_end_of_data_restrictions= -o smtpd_error_sleep_time=0
-o smtpd_soft_error_limit=1001 -o smtpd_hard_error_limit=1000
-o smtpd_client_connection_count_limit=0
-o smtpd_client_connection_rate_limit=0
-o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_address_mappings