Postfix

Amavis / Altermime - 動態電子郵件簽名(免責聲明)

  • November 11, 2017

我正在使用amavis、postfix、dovecot執行基本的 iredmail 安裝。我想使用 declaimer 功能自動附加免責聲明(在我們的例子中是簽名)。

這樣做的原因是客戶端(ipad、outlook 等)不必配置簽名設置,並且我們對發布的實際簽名具有公司控制權。

代替:

'boss@domain.com' => 'boss.domain.com.txt'

我想去

%mailbox + ‘@’ + %domain =>  %mailbox + “.” + %domain + ‘.txt’

這樣我們就可以簡單地使用腳本來生成.txt/.htm簽名文件,只使用 mysql / php。

解決了 Amavis 使用者組…謝謝 Mark Martinec 需要兩個更改:

在 /etc/amavis/conf.d/50-user 添加

################## ---- CUSTOM SIGNATURES AS DISCLAIMERS ------- ###############################
# uses altermime to insert a different signatue per users
# signatures are located in teh /etc/postfix/signatures/ directory
# also needs a small change to amavisd code:
# nano /usr/sbin/amavisd-new  - $disclaimer_options = untaint($opt);  (add the "untaint" word before ($opt)
# each user needs two signatures (html / txt)   user.domain.com.txt user.domain.com.html


 $altermime = '/usr/bin/altermime';

 $defang_maps_by_ccat{+CC_CATCHALL} = [ 'disclaimer' ];
 @disclaimer_options_bysender_maps = ( { '.' => '$3.$5' } );
 @altermime_args_disclaimer = qw(--disclaimer=/etc/postfix/signatures/_OPTION_.txt --disclaimer-html=/etc/postfix/signatures/_OPTION_.html --force-for-bad-html);


################## ---- END CUSTOM SIGNATURES AS DISCLAIMERS ------- ###############################

確保允許免責聲明沒有被註釋掉並且 => 1

$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
};

對 Altermime 做一個小改動:

nano /usr/sbin/amavisd-new  - $disclaimer_options = untaint($opt);  (add the "untaint" word before ($opt)

重新啟動 Amavis(可能必須終止程序)

引用自:https://serverfault.com/questions/401900