[英]How to mark an email as Junk\Spam in PHP?
I am developing an email client using PHP. 我正在使用PHP开发电子邮件客户端。 I have got a problem with mark my emails as spam because php library
imap
doesn't support mark as spam when I mark the emails as a spam. 我将电子邮件标记为垃圾邮件时遇到问题,因为当我将电子邮件标记为垃圾邮件时,php库
imap
不支持将其标记为垃圾邮件。 The only things I can see which it can set the emails as flagged which is not a good thing. 我所看到的唯一可以将电子邮件设置为已标记的东西并不是一件好事。 When I send the spam emails to my server after I set the emails as flagged, I will still get the spam emails in my inbox.
将电子邮件设置为标记后,当我将垃圾邮件发送到服务器时,我仍然会在收件箱中收到垃圾邮件。
However, I did a quick research and it said that I would need to use spamassassin to set up the rules. 但是,我进行了快速研究,并说我需要使用spamassassin来设置规则。 I have got spamassassin installed on my server, but I have got no idea how to use it.
我的服务器上安装了spamassassin,但是我不知道如何使用它。
Do you know how I could mark my emails as spam using PHP API to set up the rules on spamassassin? 您知道如何使用PHP API在spamassassin上设置电子邮件规则以将电子邮件标记为垃圾邮件吗?
When I set up the rules on spamassassin to mark my emails as spam, will my emails go straight to spam next time when I send the emails? 当我在spamassassin上设置规则以将电子邮件标记为垃圾邮件时,下次发送电子邮件时我的电子邮件会直接变为垃圾邮件吗?
Thank you. 谢谢。
Do you know how I could mark my emails as spam using PHP API to set up the rules on spamassassin?
您知道如何使用PHP API在spamassassin上设置电子邮件规则以将电子邮件标记为垃圾邮件吗?
Automated learning of spam is done, in SA, via a Bayesian classifier. 通过贝叶斯分类器在SA中自动学习垃圾邮件。 The training tool is
sa-learn
and you can pipe messages into it through STDIN . 培训工具是
sa-learn
,您可以通过STDIN将消息传递到其中 。
When I set up the rules on spamassassin to mark my emails as spam, will my emails go straight to spam next time when I send the emails?
当我在spamassassin上设置规则以将电子邮件标记为垃圾邮件时,下次发送电子邮件时我的电子邮件会直接变为垃圾邮件吗?
No. 没有。
You need to configure your MDA to both: 您需要同时将MDA配置为:
For example, my MDU is configured to run incoming mail through Procmail and my ~/.procmailrc
includes: 例如,我的MDU配置为通过Procmail运行传入邮件,而我的
~/.procmailrc
包括:
:0
* ^X-Spam-Level: \*\*\*\*\*\*\*\*
/dev/null
:0:
* ^X-Spam-Level: \*\*\*
$HOME/Maildir/.Junk/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.