如何使通过 Network.Mail.Mime 发送的邮件不被分类为垃圾邮件?
我使用 lib Network.Mail.Mime 从我的 Haskell 程序发送电子邮件。我认为它使用 postfix 来发送电子邮件。当我尝试将邮件发送到我的 gmail 地址时,我确实收到了它们,只是它们在垃圾箱中,无论我填写“表格”填写什么,都会发生这种情况。 我怎样才能避免这种行为? 谢谢
I use lib Network.Mail.Mime to send emails from my Haskell program. I reckon it uses postfix to send the emails. When I try to send mails to my gmail address I do receive them, only they are in the junk, and this happens whatever I fill the "form" fill with.
How can I avoid this behavior?
Thx
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
mime-mail 接口将使用简单的 api 通过 sendmail 发送电子邮件:
假设您正确使用
Data.Text
来避免区域设置编码问题。现在,这可能会设置不足的标头,因此垃圾邮件过滤器会命中它。您可能需要要求 gmail 不将此邮件归类为垃圾邮件,或者您可以设置更多标头,使其看起来不像假电子邮件。
The mime-mail interface will send email, via sendmail, using the simple api:
assuming you're correctly using
Data.Text
to avoid locale encoding issues.Now, this is likely to set insufficient headers, so the spam filter will hit it. You may need to ask gmail to not classify this as spam, or alternatively you could set more headers so it doesn't look like fake email.
Don 关于 sendmail 和标头问题的说法是正确的。但仅邮件标头通常不足以防止邮件被标记为垃圾邮件。它可能与您的 IP 范围被列入黑名单有关,或者与您发送邮件的方法没有明确关联的任何其他因素有关。第一步是检查您正在使用的邮箱中的邮件通常是如何标记的,并根据具体情况,将 sendmail 配置为通过授权连接转发到受信任的邮件代理等。
Don is right about sendmail and the headers issue. But mail headers alone often aren't enough to prevent mail being marked as spam. It can be related to your ip range being blacklisted, or any number of other things not explicitly tied to the method by which you send mail. The first step is to check how mail from the box you're using is marked in general, and depending on the situation, to configure sendmail to forward through an authorized connection to a trusted mail agent, etc.
就像前面提到的 sclv 一样,它可能是由许多问题引起的。
我刚刚经历了类似的磨难,spamassassin 给了我很大的帮助。我所有收到的电子邮件都通过 SpamAssassin 运行,它在标头中留下有关其使用的启发式方法的信息,或者更确切地说,哪些启发式方法失败了。如果您要发送 HTML 邮件,请确保您有足够类似的纯内容,并且您有一个正确的发件人等。
我向自己发送了一封与 Don Stewart 类似的邮件,这些是 spamassassin 标头:
可能并非所有这些都适用适合你的情况,但它可能会给出一些提示。尝试用谷歌搜索这些启发式方法。
Like sclv mentioned already, it can be caused by many issues.
I just went through a similar ordeal, and spamassassin was a great help. All my incoming email is ran through SpamAssassin which leaves information in headers about the heuristics it used, or rather which heuristics failed. If you're sending HTML-mail, make sure you have similar enough plain content, and that you have a proper sender etc.
I sent a similar mail as Don Stewart to myself and these are the spamassassin headers:
Probably not all of them apply to your case, but it might give some hint. Try googling those heuristics.