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 6.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  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. AUTH_NA {
  47. expression = "R_DKIM_NA & R_SPF_NA & DMARC_NA & ARC_NA";
  48. score = 1.0;
  49. policy = "remove_weight";
  50. description = "Authenticating message via SPF/DKIM/DMARC/ARC not available";
  51. }
  52. AUTH_NA_OR_FAIL {
  53. expression = "!(R_DKIM_NA & R_SPF_NA & DMARC_NA & ARC_NA) & (R_DKIM_NA | R_DKIM_TEMPFAIL | R_DKIM_PERMFAIL) & (R_SPF_NA | R_SPF_DNSFAIL) & DMARC_NA & (ARC_NA | ARC_DNSFAIL)";
  54. score = 1.0;
  55. policy = "remove_weight";
  56. description = "No authenticating method SPF/DKIM/DMARC/ARC was successful";
  57. }
  58. BOUNCE_NO_AUTH {
  59. expression = "(AUTH_NA | AUTH_NA_OR_FAIL) & (BOUNCE | SUBJ_BOUNCE_WORDS)";
  60. score = 1.0;
  61. }
  62. DKIM_MIXED {
  63. expression = "-R_DKIM_ALLOW & (R_DKIM_TEMPFAIL | R_DKIM_PERMFAIL | R_DKIM_REJECT)"
  64. policy = "remove_weight";
  65. }
  66. MAIL_RU_MAILER_BASE64 {
  67. expression = "MAIL_RU_MAILER & (FROM_EXCESS_BASE64 | MIME_BASE64_TEXT | REPLYTO_EXCESS_BASE64 | SUBJ_EXCESS_BASE64 | TO_EXCESS_BASE64)";
  68. }
  69. YANDEX_RU_MAILER_CTYPE_MIXED_BOGUS {
  70. expression = "YANDEX_RU_MAILER & -HAS_ATTACHMENT & CTYPE_MIXED_BOGUS";
  71. }
  72. MAILER_1C_8_BASE64 {
  73. expression = "MAILER_1C_8 & (FROM_EXCESS_BASE64 | MIME_BASE64_TEXT | SUBJ_EXCESS_BASE64 | TO_EXCESS_BASE64)";
  74. description = "Message was sent by '1C:Enterprise 8' and uses base64 encoded data";
  75. }
  76. HACKED_WP_PHISHING {
  77. expression = "(HAS_X_POS | HAS_PHPMAILER_SIG) & HAS_WP_URI & (PHISHING | DBL_PHISH | PHISHED_OPENPHISH | PHISHED_PHISHTANK)";
  78. description = "Phish message sent by hacked Wordpress instance";
  79. policy = "leave";
  80. }
  81. COMPROMISED_ACCT_BULK {
  82. expression = "(HAS_XOIP | RCVD_FROM_SMTP_AUTH) & DCC_BULK";
  83. description = "Likely to be from a compromised account";
  84. score = 3.0;
  85. policy = "leave";
  86. }
  87. UNDISC_RCPTS_BULK {
  88. expression = "DCC_BULK & (MISSING_TO | R_UNDISC_RCPT)";
  89. description = "Missing or undisclosed recipients with a bulk signature";
  90. score = 3.0;
  91. policy = "leave";
  92. }
  93. RCVD_UNAUTH_PBL {
  94. expression = "RECEIVED_PBL & !RCVD_VIA_SMTP_AUTH";
  95. description = "Relayed through Spamhaus PBL IP without sufficient authentication (possible indicating an open relay)";
  96. score = 2.0;
  97. policy = "leave";
  98. }
  99. RCVD_DKIM_ARC_DNSWL_MED {
  100. expression = "(R_DKIM_ALLOW | ARC_ALLOW) & RCVD_IN_DNSWL_MED";
  101. description = "Sufficiently DKIM/ARC signed and received from IP with medium trust at DNSWL";
  102. score = -0.5;
  103. policy = "leave";
  104. }
  105. RCVD_DKIM_ARC_DNSWL_HI {
  106. expression = "(R_DKIM_ALLOW | ARC_ALLOW) & RCVD_IN_DNSWL_HI";
  107. description = "Sufficiently DKIM/ARC signed and received from IP with high trust at DNSWL";
  108. score = -1.0;
  109. policy = "leave";
  110. }
  111. AUTOGEN_PHP_SPAMMY {
  112. expression = "(HAS_X_POS | HAS_PHPMAILER_SIG | HAS_X_PHP_SCRIPT) & (SUBJECT_ENDS_QUESTION | SUBJECT_ENDS_EXCLAIM | MANY_INVISIBLE_PARTS)";
  113. description = "Message was generated by PHP script and contains some spam indicators";
  114. score = 1.0;
  115. policy = "leave";
  116. }
  117. PHISH_EMOTION {
  118. expression = "(PHISHING | DBL_PHISH | PHISHED_OPENPHISH | PHISHED_PHISHTANK) & (SUBJECT_ENDS_QUESTION | SUBJECT_ENDS_EXCLAIM)";
  119. description = "Phish message with subject trying to address users emotion";
  120. score = 1.0;
  121. policy = "leave";
  122. }
  123. HAS_ANON_DOMAIN {
  124. expression = "HAS_GUC_PROXY_URI | URIBL_RED | DBL_ABUSE_REDIR | HAS_ONION_URI";
  125. description = "Contains one or more domains trying to disguise owner/destination";
  126. score = 0.1;
  127. policy = "leave";
  128. }
  129. BAD_REP_POLICIES {
  130. description = "Contains valid policies but are also marked by fuzzy/bayes/SURBL/RBL";
  131. expression = "(~g-:policies) & (-g+:fuzzy | -g+:statistics | -g+:surbl | -g+:rbl)";
  132. score = 0.1;
  133. }
  134. VIOLATED_DIRECT_SPF {
  135. description = "Has no Received (or no trusted received relays) and SPF policy fails or soft fails";
  136. expression = "(R_SPF_FAIL | R_SPF_SOFTFAIL) & (RCVD_COUNT_ZERO | RCVD_NO_TLS_LAST)";
  137. policy = "leave";
  138. score = 3.5;
  139. }
  140. IP_SCORE_FREEMAIL {
  141. description = "Negate IP_SCORE when message comes from FreeMail";
  142. expression = "FREEMAIL_FROM & SENDER_REP_SPAM";
  143. score = 0.0;
  144. policy = "remove_weight";
  145. }
  146. BROKEN_HEADERS_MAILLIST {
  147. description = "Negate BROKEN_HEADERS when message comes via some mailing list";
  148. expression = "BROKEN_HEADERS & -MAILLIST";
  149. score = 0.0;
  150. policy = "remove_weight";
  151. }
  152. LEAKED_PASSWORD_SCAM {
  153. description = "Contains BTC wallet address and scam patterns";
  154. expression = "BITCOIN_ADDR & (LEAKED_PASSWORD_SCAM_RE | R_MIXED_CHARSET | R_EMPTY_IMAGE)";
  155. policy = "leave";
  156. score = 7.0;
  157. group = "scams";
  158. }
  159. FREEMAIL_AFF {
  160. expression = "(FREEMAIL_FROM | FREEMAIL_ENVFROM | FREEMAIL_REPLYTO) & R_UNDISC_RCPT & (INTRODUCTION | FROM_NAME_HAS_TITLE | FREEMAIL_REPLYTO_NEQ_FROM_DOM)";
  161. score = 4.0;
  162. policy = "leave";
  163. description = "Message exhibits strong characteristics of advance fee fraud (AFF a/k/a '419' spam) involving freemail addresses";
  164. }
  165. .include(try=true; priority=1; duplicate=merge) "$LOCAL_CONFDIR/local.d/composites.conf"
  166. .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/composites.conf"
  167. }