[英]Postfix “bad sender address syntax” causes fetchmail to re-fetch the same email repeatedly
I use fetchmail to retrieve email from an IMAP server every five minutes, passing it to a local postfix process for delivery. 我每五分钟使用fetchmail从IMAP服务器检索电子邮件,然后将其传递到本地后缀进程进行传递。 The problem: sometimes an email has an invalid "From" line (usually spam), like this one with a leading hyphen:
问题:电子邮件有时带有无效的“发件人”行(通常是垃圾邮件),例如带有前导连字符的电子邮件:
From: "- Some Dumb Spammer" <-DumbSpammer@example.com>
In this case, fetchmail retrieves the email and passes it to my local postfix process, which raises an error: 在这种情况下,fetchmail会检索电子邮件并将其传递给我的本地后缀过程,这会引发错误:
fetchmail: SMTP error: 501 5.1.7 Bad sender address syntax
This error causes fetchmail to leave the bad email sitting on the IMAP server, even when my .fetchmailrc file says nokeep
. 即使我的.fetchmailrc文件显示
nokeep
,此错误也会导致fetchmail将错误的电子邮件留在IMAP服务器上。 As a result, fetchmail re-downloads it every five minutes. 结果,fetchmail每五分钟重新下载一次。 Repeat forever... or until I manually delete the bad email from the IMAP server.
永远重复一次...或直到我从IMAP服务器手动删除错误的电子邮件。
What's the best way to break these loops automatically, either deleting or delivering the bad email, without opening a security hole (eg, permitting leading hyphens)? 在没有打开安全漏洞(例如,允许使用连字符)的情况下,自动打破这些循环(删除或发送不良电子邮件)的最佳方法是什么? Thank you.
谢谢。
The kind people on the fetchmail-users mailing list answered my question . fetchmail-users邮件列表上的好心人回答了我的问题 。 To summarize their response, you can use
fetchmail --nosoftbounce
to permanently delete undeliverable messages, use the antispam option to accept the emails ( fetchmail -Z 501
), or configure postfix to permit leading hyphens if it's safe to do so. 总结他们的响应,您可以使用
fetchmail --nosoftbounce
永久删除无法传递的邮件,使用antispam选项接受电子邮件( fetchmail -Z 501
),或配置后缀以允许前置连字符(如果安全的话)。 The options are documented on the fetchmail man page. 这些选项记录在fetchmail手册页上。
Remove Asp TAG username 'admin@seudominio.com.br' == admin@seudominio.com.br
: 删除Asp TAG用户名
'admin@seudominio.com.br' == admin@seudominio.com.br
:
#!/bin/sh
set logfile '/var/log/fetchmaillog'
set no bouncemail
defaults fetchall
poll locapack.com.br with protocol pop3
username admin@seudominio.com.br password xxxx is admin@seudominio.com.br here;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.