關於 PHP, Linux, Open Source 及個人生活記載的網誌。
RSS icon
  • 兩個實用的 Sendmail 配置

    Posted on February 16th, 2006 Sam Tang 1 comment

    修改郵件停留在 queue 的時間
    當電郵伺服器發出的郵件退信時,郵件會停留在 queue 一段時間及重複嘗試發出,sendmail 的預設值是 5 天才會放棄及把郵件從 queue 中刪除。

    我想將這個時間縮短,那可以打開 /etc/mail/sendmail.cf,裡面有一行:

    “O Timeout.queuereturn=5d”

    5d 代表 5 天,我只想發送失敗的郵件停留在 queue 裡面 12 小時,可以改成:

    “O Timeout.queuereturn=12h”

    然後重新啟動 sendmail 即可。

    限制每封電郵收件者
    Sendmail 預設沒有限制每封電郵的收件者,那麼用戶就可以將電郵伺服器用作發送廣告信,要限制收件人數也是打開 /etc/mail/sendmail.cf,裡面有一行是:

    #O MaxRecipientsPerMessage=100

    將第一個 “#” 刪除,及將 100 改成你想要的數值,我自己是用 20,然後重新啟動 sendmail 即可。


     

    One response to “兩個實用的 Sendmail 配置”

    1. /etc/mail/sendmail.cf,這要從那裡選擇!!^_^

    Leave a reply

    *
    To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
    Click to hear an audio file of the anti-spam word