postfix如何暫時保留使用者寄出的信

有時候要讓寄件者, 寄到某些網域的信保留在server, 而不真正寄發出去, 這時候要觸發 HOLD 機制, 作法如下:
1. 在smtpd_recipient_restrictions第一行加上以下設定
smtpd_recipient_restrictions =
check_recipient_access hash:/etc/postfix/hold

2. vi /etc/postfix/hold 內容
###################
test.com HOLD
###################

3. postmap hash:/etc/postfix/hold

4. postfix reload

5. 若要刪除HOLD住的郵件
執行
postsuper -d ALL hold

 

6.若要解除HOLD郵件, 執行

postsuper -H ALL

發表迴響