我有不同传输的postfix。对于其中一个传输,我想禁用消息反弹。
master.cf
smtp inet n - n - - smtpd
pickup fifo n - n 60 1 pickup
cleanup unix n - n - 0 cleanup
qmgr fifo n - n 300 1 qmgr
tlsmgr unix - - n 1000? 1 tlsmgr
rewrite unix - - n - - trivial-rewrite
bounce unix - - n - 0 bounce
defer unix - - n - 0 bounce
trace unix - - n - 0 bounce
verify unix - - n - 1 verify
flush unix n - n 1000? 0 flush
proxymap unix - - n - - proxymap
proxywrite unix - - n - 1 proxymap
smtp unix - - n - - smtp
relay unix - - n - - smtp
-o smtp_fallback_relay=
showq unix n - n - - showq
error unix - - n - - error
retry unix - - n - - error
discard unix - - n - - discard
local unix - n n - - local
virtual unix - n n - - virtual
lmtp unix - - n - - lmtp
anvil unix - - n - 1 anvil
scache unix - - n - 1 scache
dovecot unix - n n - - pipe
flags=DRhu user=vmail:mail argv=/usr/libexec/dovecot/deliver -d $(recipient)
emailtransport unix - n n - - pipe
flags=X user=transpostfix argv=/media/raid1m/mailparse/emailtransport.php
#****** other options ************
other2emailtransport unix - n n - - pipe
flags=X user=other2transpostfix argv=/media/raid1m/mailparse/other2emailtransport.php
日志输出:
Mar 26 15:35:14 machin1 postfix/smtpd[12110]: connect from client=68.ip-11-11-10.eu[11.12.13.14]
Mar 26 15:35:14 machin1 postfix/smtpd[12125]: connect from client=68.ip-11-11-10.eu[11.12.13.14]
Mar 26 15:35:14 machin1 postfix/pipe[3893]: 0738C180997: to=<transpostfix@localhost.localhost>, orig_to=<zauri.t@ass.exemple.com.domain>, relay=emailtransport, delay=0.5, delays=0.07/0/0/0.42, dsn=2.0.0, status=sent (delivered via emailtransport service)
Mar 26 15:35:14 machin1 postfix/qmgr[12106]: 0738C180997: removed
Mar 26 15:35:14 machin1 postfix/smtpd[12110]: setting up TLS connection from client=68.ip-11-11-10.eu[11.12.13.14]
Mar 26 15:35:14 machin1 postfix/smtpd[12125]: CC0FF180996: client=client=68.ip-11-11-10.eu[11.12.13.14]
Mar 26 15:35:14 machin1 postfix/smtpd[21657]: disconnect from client=68.ip-11-11-10.eu[11.12.13.14]
Mar 26 15:35:14 machin1 postfix/smtpd[12110]: Anonymous TLS connection established from client=68.ip-11-11-10.eu[11.12.13.14]: TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)
Mar 26 15:35:15 machin1 postfix/smtpd[12224]: 1662E180997: client=client=68.ip-11-11-10.eu[11.12.13.14]
Mar 26 15:35:15 machin1 postfix/cleanup[20853]: CC0FF180996: message-id=<a779c13adb0ff35fc576b6a9a3a779c7@async.clubggff.com>
Mar 26 15:35:15 machin1 postfix/qmgr[12106]: CC0FF180996: from=<notification+kjdkjivh3i_d@example-mail.com>, size=16051, nrcpt=1 (queue active)
Mar 26 15:35:15 machin1 postfix/smtpd[12110]: 6873F180998: client=client=68.ip-11-11-10.eu[11.12.13.14]
Mar 26 15:35:15 machin1 postfix/cleanup[21196]: 1662E180997: message-id=<cb01d448de2987547cd69fcab1e92f92@async.clubggff.com>
Mar 26 15:35:15 machin1 postfix/pipe[6928]: CC0FF180996: to=<transpostfix@localhost.localhost>, orig_to=<s01064154705@add3000.exemple.com.domain>, relay=emailtransport, delay=0.97, delays=0.55/0/0/0.42, dsn=2.0.0, status=sent (delivered via emailtransport service)
Mar 26 15:35:15 machin1 postfix/qmgr[12106]: CC0FF180996: removed
Mar 26 15:35:15 machin1 postfix/cleanup[21201]: 6873F180998: message-id=<1729890133889801-1540059429539540@groups.clubggff.com>
Mar 26 15:35:15 machin1 postfix/qmgr[12106]: 1662E180997: from=<notification+kjdkj5wd1k3_@example-mail.com>, size=18421, nrcpt=1 (queue active)
Mar 26 15:35:15 machin1 postfix/qmgr[12106]: 6873F180998: from=<notification+kjdkpj3hdv5d@example-mail.com>, size=24947, nrcpt=1 (queue active)
Mar 26 15:35:16 machin1 postfix/pipe[6941]: 1662E180997: to=<transpostfix@localhost.localhost>, orig_to=<margaretgarza@add3000.exemple.com.domain>, relay=emailtransport, delay=1.4, delays=0.95/0/0/0.41, dsn=2.0.0, status=sent (delivered via emailtransport service)
Mar 26 15:35:16 machin1 postfix/qmgr[12106]: 1662E180997: removed
Mar 26 15:35:16 machin1 postfix/smtpd[12154]: NOQUEUE: reject: RCPT from client=68.ip-11-11-10.eu[11.12.13.14]: 504 5.5.2 <164.132.109.68>: Helo command rejected: need fully-qualified hostname; from=<mbeuwen@sfilc.com> to=<t120304677@yahoo.com.tw> proto=SMTP helo=<164.132.109.68>
Mar 26 15:35:16 machin1 postfix/smtpd[12130]: disconnect from client=68.ip-11-11-10.eu[11.12.13.14]
Mar 26 15:35:16 machin1 postfix/smtpd[12157]: connect from client=68.ip-11-11-10.eu[11.12.13.14]
Mar 26 15:35:16 machin1 postfix/pipe[6938]: 6873F180998: to=<transpostfix@localhost.localhost>, orig_to=<fgbdfscxw@my-dom.exemple.com.domain>, relay=emailtransport, delay=1, delays=0.58/0/0/0.47, dsn=5.3.0, status=bounced (Command died with status 255: "/media/raid1m/mailparse/emailtransport.php")
Mar 26 15:35:16 machin1 postfix/cleanup[22236]: 4FFE918099A: message-id=<20160326133516.4FFE918099A@1.444.exemple.com.domain>
Mar 26 15:35:16 machin1 postfix/bounce[10936]: 6873F180998: sender non-delivery notification: 4FFE918099A
Mar 26 15:35:16 machin1 postfix/qmgr[12106]: 4FFE918099A: from=<>, size=27004, nrcpt=1 (queue active)
Mar 26 15:35:16 machin1 postfix/qmgr[12106]: 6873F180998: removed
Mar 26 15:35:16 machin1 postfix/error[10938]: 4FFE918099A: to=<notification+kjdkpj3hdv5d@example-mail.com>, relay=none, delay=0.03, delays=0.01/0.01/0/0.01, dsn=4.3.5, status=deferred (delivery temporarily suspended: Host or domain name not found. Name service error for name=delete-lev.exemple.com.domain type=A: Host not found)
我需要为 emailtransport 禁用跳出。有时候emailtransport.php会出错,但这正是我想要的工作。
如何关闭任何退回邮件至 emailtransport ,以免影响工作或其他传输,例如 other2emailtransport
我不需要这个:
Mar 26 15:35:16 machin1 postfix/pipe[6938]: 6873F180998: to=<transpostfix@localhost.localhost>, orig_to=<fgbdfscxw@my-dom.exemple.com.domain>, relay=emailtransport, delay=1, delays=0.58/0/0/0.47, dsn=5.3.0, status=bounced (Command died with status 255: "/media/raid1m/mailparse/emailtransport.php")
Mar 26 15:35:16 machin1 postfix/cleanup[22236]: 4FFE918099A: message-id=<20160326133516.4FFE918099A@1.444.exemple.com.domain>
Mar 26 15:35:16 machin1 postfix/bounce[10936]: 6873F180998: sender non-delivery notification: 4FFE918099A
命令以状态255 死亡后,我需要删除消息6873F180998。并且不要发送绑定消息4FFE918099A。
答案 0 :(得分:0)
我解决了我的问题,但它并没有完全回答我的问题。
在文档中写道:http://www.postfix.org/pipe.8.html
DIAGNOSTICS
Command exit status codes are expected to follow the conventions
defined in <sysexits.h>. Exit status 0 means normal successful comple-
tion.
In the case of a non-zero exit status, a limited amount of command out-
put is logged, and reported in a delivery status notification. When
the output begins with a 4.X.X or 5.X.X enhanced status code, the sta-
tus code takes precedence over the non-zero exit status (Postfix ver-
sion 2.3 and later).
这意味着我需要让我的PHP脚本放出EXIT(0);
我开启了错误ini_set('error_reporting', -1);
的报告,并在脚本中发现了问题。当我修复此脚本时,错误消失了,问题解决了。
思考如何解决问题的其他理论选择(但我不确定这是否可行):