最後更新: 2016-01-05
amavisd 設定
invokes $altermime program for outgoing mail with arguments as given in @altermime_args_disclaimer;
# 新增 port 10024~10026
$inet_socket_port = [10024,10026];
# 選擇 port 10026 set policy 並 Enable "allow_disclaimers"
$interface_policy{'10026'} = 'ORIGINATING';
$policy_bank{'ORIGINATING'} = {
originating => 1, # declare that mail was submitted by our smtp client
allow_disclaimers => 1, # enables disclaimer insertion if available
};
# Uncomment this line to enable singing disclaimer in outgoing mails.
$defang_maps_by_ccat{+CC_CATCHALL} = [ 'disclaimer' ];
# 記得要設定好
@local_domains_maps = ['datahunter.org', 'YOUR_DOMAIN.LTD',];
# Program used to signing disclaimer in outgoing mails.
$altermime = '/usr/bin/altermime';
# 因應不同的內容(txt, html)出不同的 disclaimer
# "_OPTION_" 會對應 "disclaimer_options_bysender_maps" 的設定, 它是 placeholder 來
# --disclaimer=, Set the plaintext disclaimer source file.
# --disclaimer-html=, Set the HTML disclaimer source file.
# --force-for-bad-html, Force adding of the HTML disclaimer even when HTML is not correctly formatted
@altermime_args_disclaimer = qw( --disclaimer=/etc/postfix/disclaimer/_OPTION_.txt --disclaimer-html=/etc/postfix/disclaimer/_OPTION_.html --force-for-bad-html);
# Per-Domain / Per-User Setting
@disclaimer_options_bysender_maps = ({ # Per-domain disclaimer setting: /etc/postfix/disclaimer/datahunter.org.txt 'datahunter.org' => 'datahunter.org', # Per-user disclaimer setting: /etc/postfix/disclaimer/postmaster.datahunter.org.txt '[email protected]' => 'postmaster.datahunter.org', # Catch-all disclaimer setting: /etc/postfix/disclaimer/default.txt '.' => 'default', },);
postfix setting
master.cf
submission inet n - n - - smtpd -o syslog_name=postfix/submission -o smtpd_tls_security_level=may -o smtpd_sasl_auth_enable=yes -o smtpd_client_restrictions=permit_mynetworks,permit_sasl_authenticated,reject -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_address_mappings -o content_filter=amavis:[127.0.0.1]:10026