linux – 如何使spamassasin根据分数拒绝邮件?

前端之家收集整理的这篇文章主要介绍了linux – 如何使spamassasin根据分数拒绝邮件?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用Postfix,Dovecot,Postgrey和spamassasin / spamd运行 Linux.

这是我的main.cf

  1. smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination,reject_invalid_hostname,reject_unauth_pipelining,reject_non_fqdn_sender,reject_unknown_sender_domain,reject_non_fqdn_recipient,reject_unknown_recipient_domain,check_policy_service inet:127.0.0.1:10030

我有spamassasin将垃圾邮件标题添加到postfix没有捕获的其他电子邮件,但如何让它拒绝?

解决方法

您可以配置postfix以使用Spamassasin / Amavis作为代理过滤器.这样可以防止退回:在完成垃圾邮件检查之前,与SMTP远程端的连接将保持打开状态,并且后缀将以OK或REJECTED消息进行响应.这样,远程端负责跳出.
  1. # master.cf
  2.  
  3. # mail inbound
  4. smtp inet n - - - - smtpd
  5. -o smtpd_proxy_filter=127.0.0.1:10024
  6. -o smtpd_client_connection_count_limit=10
  7. -o smtpd_proxy_options=speed_adjust
  8.  
  9. # spamassasin/amavis is listening to port 10024 and sending it's
  10. # checked mail to port 10025
  11. amavis unix - - n - 2 smtp
  12. -o smtp_data_done_timeout=1200
  13. -o smtp_send_xforward_command=yes
  14. -o disable_dns_lookups=yes
  15.  
  16. # SMTP return (from amavis/spamassasin)
  17. localhost:10025 inet n - n - - smtpd
  18. -o content_filter=
  19. -o local_recipient_maps=
  20. -o relay_recipient_maps=
  21. -o smtpd_restriction_classes=
  22. -o smtpd_client_restrictions=
  23. -o smtpd_helo_restrictions=
  24. -o smtpd_sender_restrictions=
  25. -o smtpd_recipient_restrictions=permit_mynetworks,reject
  26. -o smtpd_override_options=no_address_mappings
  27. -o mynetworks=127.0.0.0/8
  28. -o receive_override_options=no_unknown_recipient_checks
  1. # main.cf
  2.  
  3. # for rejecting spam
  4. header_checks = pcre:/etc/postfix/header_checks
  1. # header_checks
  2.  
  3. /X-Spam-Level: \*{9,}/ REJECT Looks like spam to me.

如果你使用Amavis来调用spamassasin,你可以让Amavis为你拒绝邮件 – 拒绝threashold可以配置$sa_kill_level_deflt.使用Amavis时,将SMTP返回条目中的no_header_body_checks添加到receive_override_options.

猜你在找的Linux相关文章