Sendmail check_*
Posted On 2012年10月5日 星期五 at 於 上午9:27 by Lani最近遇到一些Sendmail的問題,
認真的研究一下後,發現其實Sendmail也蠻多檢查機制。
Introduction
If you plan to upgrade your sendmail version, go directly to the current release of sendmail (or at least 8.9.3) which has standard FEATUREs included. However, you may read on, because this page and related pages give background informations about the check_* rulesets.
sendmail 8.8 introduced several new rulesets to control who can use your machine to send/relay e-mail and to avoid UBE from well known sites. These are:
- check_relay
- checking the host name and host address separated by $|. This ruleset is called whenever a client connects via (E)SMTP to the server.
- check_mail
- for the MAIL command.
- check_rcpt
- for the RCPT command (used to prevent unauthorized relaying). This ruleset disables all kinds of known relaying tricks (the trick which is tested by ORBS currently (1999-07-14) is fixed since the end of 1997 according to my logs).
- check_compat
- checking both MAIL and RCPT also separated by $| before delivery.
http://www.sendmail.org/~ca/email/check.html#check_rcpt
Sendmail Server IP In RBL List 會造成 Sendmail Server 誤判
Posted On 2008年8月20日 星期三 at 於 下午3:41 by Lani對方主機給的訊息:RBL matched Blocked - see http://cbl.abuseat.org/lookup.cgi?ip=210.68.43.7
Sendmail主機Log卻產生誤判為:dsn=5.1.1, stat=User unknown,
造成管理者判斷錯誤,無法發現自已主機被列入RBL Blocklist,無法即時處理。
對方主機 Log
2008-08-20 14:43:49 H=(mailserver) [210.68.43.7]:49842 I=[210.68.43.8]:25 F=
Sendmail Log
Aug 18 14:43:49 mailserver sendmail[3463]: m7I6hnH2003461: to=
Aug 18 17:05:06 mailserver sendmail[32762]: m7I9566c032758: to=
Sendmail 指令發監控信
Posted On 2008年1月23日 星期三 at 於 下午6:08 by Lani直接發信指令
/bin/df -h | /usr/bin/mail -s "server capacity" yourname@yourdomain
下完指令,可以直接看maillog是否有發信紀錄即可。
tail -f /var/log/maillog
Sendmail 設定 queue time & MaxRecipients
Posted On at 於 下午5:49 by Lani1、設定郵件在 queue 的時間
當郵件寄不到對方時,郵件會停留在 queue & 重複嘗試重送,sendmail 預設值是 5 天才會放棄重送並把郵件從 queue 中刪除。
將修改這個時間,vi /etc/mail/sendmail.cf,裡面有一行:
“O Timeout.queuereturn=5d”
5d 代表 5 天,我只想發送失敗的郵件,停留在 queue 裡面 24小時,可以改成:
“O Timeout.queuereturn=24h”
然後重新啟動 sendmail 即可。
2、限制每封郵件收件者數量
Sendmail 預設沒有限制每封郵件的收件者數量,要限制收件者人數,vi /etc/mail/sendmail.cf,裡面有一行是:
#O MaxRecipientsPerMessage=100
將第一個 “#” 刪除,然後重新啟動 sendmail 即可。