You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

composites.conf 5.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. # Composites setup
  2. # Please don't modify this file as your changes might be overwritten with
  3. # the next update.
  4. #
  5. # You can modify 'local.d/composites.conf' to add and merge
  6. # parameters defined inside this section
  7. #
  8. # You can modify 'override.d/composites.conf' to strictly override all
  9. # parameters defined inside this section
  10. #
  11. # See https://rspamd.com/doc/faq.html#what-are-the-locald-and-overrided-directories
  12. # for details
  13. #
  14. # See https://rspamd.com/doc/tutorials/writing_rules.html and
  15. # https://rspamd.com/doc/configuration/composites.html for details
  16. composites {
  17. FORGED_RECIPIENTS_MAILLIST {
  18. expression = "FORGED_RECIPIENTS & -MAILLIST";
  19. }
  20. FORGED_SENDER_MAILLIST {
  21. expression = "FORGED_SENDER & -MAILLIST";
  22. }
  23. FORGED_SENDER_FORWARDING {
  24. expression = "FORGED_SENDER & g:forwarding";
  25. description = "Forged sender, but message is forwarded";
  26. policy = "remove_weight";
  27. }
  28. SPF_FAIL_FORWARDING {
  29. expression = "g:forwarding & (R_SPF_SOFTFAIL | R_SPF_FAIL)";
  30. policy = "remove_weight";
  31. }
  32. DMARC_POLICY_ALLOW_WITH_FAILURES {
  33. expression = "DMARC_POLICY_ALLOW & (R_SPF_SOFTFAIL | R_SPF_FAIL | R_DKIM_REJECT)";
  34. policy = "remove_weight";
  35. }
  36. FORGED_RECIPIENTS_FORWARDING {
  37. expression = "FORGED_RECIPIENTS & g:forwarding";
  38. policy = "remove_weight";
  39. }
  40. FORGED_SENDER_VERP_SRS {
  41. expression = "FORGED_SENDER & (ENVFROM_PRVS | ENVFROM_VERP)";
  42. }
  43. FORGED_MUA_MAILLIST {
  44. expression = "g:mua & -MAILLIST";
  45. }
  46. RBL_SPAMHAUS_XBL_ANY {
  47. expression = "RBL_SPAMHAUS_XBL & RECEIVED_SPAMHAUS_XBL";
  48. description = "From and Received address are listed in Spamhaus XBL";
  49. }
  50. AUTH_NA {
  51. expression = "R_DKIM_NA & R_SPF_NA & DMARC_NA & ARC_NA";
  52. score = 1.0;
  53. policy = "remove_weight";
  54. description = "Authenticating message via SPF/DKIM/DMARC/ARC not possible";
  55. }
  56. DKIM_MIXED {
  57. expression = "-R_DKIM_ALLOW & (R_DKIM_TEMPFAIL | R_DKIM_PERMFAIL | R_DKIM_REJECT)"
  58. policy = "remove_weight";
  59. }
  60. MAIL_RU_MAILER_BASE64 {
  61. expression = "MAIL_RU_MAILER & (FROM_EXCESS_BASE64 | MIME_BASE64_TEXT | REPLYTO_EXCESS_BASE64 | SUBJ_EXCESS_BASE64 | TO_EXCESS_BASE64)";
  62. }
  63. YANDEX_RU_MAILER_CTYPE_MIXED_BOGUS {
  64. expression = "YANDEX_RU_MAILER & -HAS_ATTACHMENT & CTYPE_MIXED_BOGUS";
  65. }
  66. MAILER_1C_8_BASE64 {
  67. expression = "MAILER_1C_8 & (FROM_EXCESS_BASE64 | MIME_BASE64_TEXT | SUBJ_EXCESS_BASE64 | TO_EXCESS_BASE64)";
  68. description = "Message was sent by '1C:Enterprise 8' and uses base64 encoded data";
  69. }
  70. HACKED_WP_PHISHING {
  71. expression = "(HAS_X_POS | HAS_PHPMAILER_SIG) & HAS_WP_URI & (PHISHING | DBL_PHISH | PHISHED_OPENPHISH | PHISHED_PHISHTANK)";
  72. description = "Phish message sent by hacked Wordpress instance";
  73. policy = "leave";
  74. }
  75. COMPROMISED_ACCT_BULK {
  76. expression = "(HAS_XOIP | RCVD_FROM_SMTP_AUTH) & DCC_BULK";
  77. description = "Likely to be from a compromised account";
  78. score = 3.0;
  79. policy = "leave";
  80. }
  81. UNDISC_RCPTS_BULK {
  82. expression = "DCC_BULK & (MISSING_TO | R_UNDISC_RCPT)";
  83. description = "Missing or undisclosed recipients with a bulk signature";
  84. score = 3.0;
  85. policy = "leave";
  86. }
  87. RCVD_UNAUTH_PBL {
  88. expression = "RECEIVED_PBL & !RCVD_VIA_SMTP_AUTH";
  89. description = "Relayed through ZEN PBL IP without sufficient authentication (possible indicating an open relay)";
  90. score = 2.0;
  91. policy = "leave";
  92. }
  93. RCVD_DKIM_ARC_DNSWL_MED {
  94. expression = "(R_DKIM_ALLOW | ARC_ALLOW) & RCVD_IN_DNSWL_MED";
  95. description = "Sufficiently DKIM/ARC signed and received from IP with medium trust at DNSWL";
  96. score = -0.5;
  97. policy = "leave";
  98. }
  99. RCVD_DKIM_ARC_DNSWL_HI {
  100. expression = "(R_DKIM_ALLOW | ARC_ALLOW) & RCVD_IN_DNSWL_HI";
  101. description = "Sufficiently DKIM/ARC signed and received from IP with high trust at DNSWL";
  102. score = -1.0;
  103. policy = "leave";
  104. }
  105. AUTOGEN_PHP_SPAMMY {
  106. expression = "(HAS_X_POS | HAS_PHPMAILER_SIG | HAS_X_PHP_SCRIPT) & (SUBJECT_ENDS_QUESTION | SUBJECT_ENDS_EXCLAIM | MANY_INVISIBLE_PARTS)";
  107. description = "Message was generated by PHP script and contains some spam indicators";
  108. score = 1.0;
  109. policy = "leave";
  110. }
  111. PHISH_EMOTION {
  112. expression = "(PHISHING | DBL_PHISH | PHISHED_OPENPHISH | PHISHED_PHISHTANK) & (SUBJECT_ENDS_QUESTION | SUBJECT_ENDS_EXCLAIM)";
  113. description = "Phish message with subject trying to address users emotion";
  114. score = 1.0;
  115. policy = "leave";
  116. }
  117. HAS_ANON_DOMAIN {
  118. expression = "HAS_GUC_PROXY_URI | URIBL_RED | DBL_ABUSE_REDIR | HAS_ONION_URI";
  119. description = "Contains one or more domains trying to disguise owner/destination";
  120. score = 0.1;
  121. policy = "leave";
  122. }
  123. BAD_REP_POLICIES {
  124. description = "Contains valid policies but are also marked by fuzzy/bayes/surbl/rbl";
  125. expression = "(~g-:policies) & (-g+:fuzzy | -g+:statistics | -g+:surbl | -g+:rbl)";
  126. score = 0.1;
  127. }
  128. VIOLATED_DIRECT_SPF {
  129. description = "Has no Received (or no trusted received relays) and SPF policy fails or soft fails";
  130. expression = "(R_SPF_FAIL | R_SPF_SOFTFAIL) & (RCVD_COUNT_ZERO | RCVD_NO_TLS_LAST)";
  131. policy = "leave";
  132. score = 3.5;
  133. }
  134. IP_SCORE_FREEMAIL {
  135. description = "Negate IP_SCORE when message comes from FreeMail";
  136. expression = "FREEMAIL_FROM & SENDER_REP_SPAM";
  137. score = 0.0;
  138. policy = "remove_weight";
  139. }
  140. BROKEN_HEADERS_MAILLIST {
  141. description = "Negate BROKEN_HEADERS when message comes via some mailing list";
  142. expression = "BROKEN_HEADERS & -MAILLIST";
  143. score = 0.0;
  144. policy = "remove_weight";
  145. }
  146. LEAKED_PASSWORD_SCAM {
  147. description = "Contains BTC wallet address and scam patterns";
  148. expression = "BITCOIN_ADDR & (LEAKED_PASSWORD_SCAM_RE | R_MIXED_CHARSET | R_EMPTY_IMAGE)";
  149. policy = "leave";
  150. score = 7.0;
  151. group = "scams";
  152. }
  153. .include(try=true; priority=1; duplicate=merge) "$LOCAL_CONFDIR/local.d/composites.conf"
  154. .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/composites.conf"
  155. }