Postfix 自訂退信訊息範本
作者: cross 日期: 2008-04-24 12:28
Postfix 版本需要 2.3 以上
先確認版本 → postconf -d | grep mail_version
編輯 vi /etc/postfix/bounce.cf
將設定寫入 /etc/postfix/main.cf
先確認版本 → postconf -d | grep mail_version
可以使用的範本名稱有mail_version = 2.4.5
milter_macro_v = $mail_name $mail_version
使用方式是用 failure_template = <<EOF 為開頭,EOF 結尾failure_template
delay_template
success_template
verify_template
編輯 vi /etc/postfix/bounce.cf
以上中文部份是由翻譯機器所翻的#
# The failure template is used when mail is returned to the sender;
# either the destination rejected the message, or the destination
# could not be reached before the message expired in the queue.
failure_template = <<EOF
Charset: utf-8
From: MAILER-DAEMON (Mail Delivery System)
Subject: Undelivered Mail Returned to Sender
Postmaster-Subject: Postmaster Copy: Undelivered Mail
這是在電子郵件系統主機 $myhostname 。
我很抱歉地通知您,您的郵件無法
交付給一個或多個收件人。它附在下面。
如需進一步的協助,請發送電子郵件至<postmaster>
如果您這樣做,請包括這個問題報告。您可以
刪除您自己的文字從所附的返回信息。
The mail system
EOF
#
# The delay template is used when mail is delayed. Note a neat trick:
# the default template displays the delay_warning_time value as hours
# by appending the _hours suffix to the parameter name; it displays
# the maximal_queue_lifetime value as days by appending the _days
# suffix.
#
# Other suffixes are: _seconds, _minutes, _weeks. There are no other
# main.cf parameters that have this special behavior.
#
# You need to adjust these suffixes (and the surrounding text) if
# you have very different settings for these time parameters.
#
delay_template = <<EOF
Charset: utf-8
From: MAILER-DAEMON (Mail Delivery System)
Subject: Delayed Mail (still being retried)
Postmaster-Subject: Postmaster Warning: Delayed Mail
This is the mail system at host $myhostname.
####################################################################
# THIS IS A WARNING ONLY. YOU DO NOT NEED TO RESEND YOUR MESSAGE. #
####################################################################
您的郵件無法交付美元以上 $delay_warning_time_hours 小時(星期日) 。
這將是重試,直到為 $maximal_queue_lifetime_days 一天( S )舊。
如需進一步的協助,請發送電子郵件至<postmaster>
如果您這樣做,請包括這個問題報告。您可以
刪除您自己的文字從所附的返回信息。
The mail system
EOF
#
# The success template is used when mail is delivered to mailbox,
# when an alias or list is expanded, or when mail is delivered to a
# system that does not announce DSN support. It is an error to specify
# a Postmaster-Subject: here.
#
success_template = <<EOF
Charset: utf-8
From: MAILER-DAEMON (Mail Delivery System)
Subject: Successful Mail Delivery Report
這是在電子郵件系統主機 $myhostname 。
您的留言已成功運到目的地(星期日)
列在了下面。如果郵件被送到您的郵箱
沒有收到進一步的通知。否則,你可能還會收到
通知郵件傳遞錯誤來自其他系統。
The mail system
EOF
#
# The verify template is used for address verification (sendmail -bv
# address...). or for verbose mail delivery (sendmail -v address...).
# It is an error to specify a Postmaster-Subject: here.
#
verify_template = <<EOF
Charset: utf-8
From: MAILER-DAEMON (Mail Delivery System)
Subject: Mail Delivery Status Report
這是在電子郵件系統主機 $myhostname 。
封閉是郵件傳遞報告說,你的要求。
The mail system
EOF
將設定寫入 /etc/postfix/main.cf
postconf -e 'bounce_template_file = /etc/postfix/bounce.cf'
執行 postconf -b /etc/postfix/bounce.cf 要認 /etc/postfix/bounce.cf 裡面的變數有成功轉換,或者有沒有錯誤訊息
測試寄信至 yahoo.com.tw
收到的退信訊息
要縮短測試時間可以這麼作
postconf -e 'maximal_queue_lifetime = 1d'
postconf -e 'delay_warning_time = 0h'
postconf -e 'bounce_queue_lifetime = 1d'
參考文件: http://www.howtoforge.com/configure-custom-postfix-bounce-messages
發表評論
上一篇
返回
下一篇
標籤:




postfix 將伺服器上「查無此人」的郵件改由特定的用戶接收 (2008-07-03 20:28)
Postfix + Transport Maps 定義傳遞目的 (2008-05-19 01:20)
有人整理了一些 postfix 的文件 (英文) (2008-04-24 11:13)
postfix 加上 postgrey 擋垃圾信件 (2007-11-12 00:45)
postfix 的 mailbox 如何轉換成 maildir 郵件格式 (2007-08-04 00:08)
Postfix + 擋spam的一些機制 (2006-12-23 12:44)
Postfix + main.cf + queue (2006-12-17 00:49)
Postfix + virtual domain + MySQL + Dovecot + mailbox (2006-12-12 13:30)
Postfix + virtual domain (2006-12-06 11:26)