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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  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. SHORT_PART_BAD_HEADERS {
  18. expression = "MISSING_ESSENTIAL_HEADERS & SINGLE_SHORT_PART";
  19. group = "blankspam";
  20. policy = "leave";
  21. score = 7.0;
  22. }
  23. FORGED_RECIPIENTS_MAILLIST {
  24. expression = "FORGED_RECIPIENTS & -MAILLIST";
  25. }
  26. FORGED_SENDER_MAILLIST {
  27. expression = "FORGED_SENDER & -MAILLIST";
  28. }
  29. FORGED_SENDER_FORWARDING {
  30. expression = "FORGED_SENDER & g:forwarding";
  31. description = "Forged sender, but message is forwarded";
  32. policy = "remove_weight";
  33. }
  34. SPF_FAIL_FORWARDING {
  35. expression = "g:forwarding & (R_SPF_SOFTFAIL | R_SPF_FAIL)";
  36. policy = "remove_weight";
  37. }
  38. DMARC_POLICY_ALLOW_WITH_FAILURES {
  39. expression = "DMARC_POLICY_ALLOW & (R_SPF_SOFTFAIL | R_SPF_FAIL | R_DKIM_REJECT)";
  40. policy = "remove_weight";
  41. }
  42. FORGED_RECIPIENTS_FORWARDING {
  43. expression = "FORGED_RECIPIENTS & g:forwarding";
  44. policy = "remove_weight";
  45. }
  46. FORGED_SENDER_VERP_SRS {
  47. expression = "FORGED_SENDER & (ENVFROM_PRVS | ENVFROM_VERP)";
  48. }
  49. FORGED_MUA_MAILLIST {
  50. expression = "g:mua & -MAILLIST";
  51. }
  52. AUTH_NA {
  53. expression = "R_DKIM_NA & R_SPF_NA & DMARC_NA & ARC_NA";
  54. score = 1.0;
  55. policy = "remove_weight";
  56. description = "Authenticating message via SPF/DKIM/DMARC/ARC not available";
  57. }
  58. AUTH_NA_OR_FAIL {
  59. 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)";
  60. score = 1.0;
  61. policy = "remove_weight";
  62. description = "No authenticating method SPF/DKIM/DMARC/ARC was successful";
  63. }
  64. BOUNCE_NO_AUTH {
  65. expression = "(AUTH_NA | AUTH_NA_OR_FAIL) & (BOUNCE | SUBJ_BOUNCE_WORDS)";
  66. score = 1.0;
  67. }
  68. DKIM_MIXED {
  69. expression = "-R_DKIM_ALLOW & (R_DKIM_TEMPFAIL | R_DKIM_PERMFAIL | R_DKIM_REJECT)"
  70. policy = "remove_weight";
  71. }
  72. APPLE_MAILER_COMMON {
  73. description = "Message was sent by 'Apple Mail' and has common symbols in place";
  74. expression = "APPLE_MAILER & MV_CASE";
  75. }
  76. APPLE_IOS_MAILER_COMMON {
  77. description = "Message was sent by 'Apple iOS Mail' and has common symbols in place";
  78. expression = "APPLE_IOS_MAILER & (MV_CASE | MIME_MA_MISSING_TEXT)";
  79. }
  80. HACKED_WP_PHISHING {
  81. expression = "(HAS_X_POS | HAS_PHPMAILER_SIG) & HAS_WP_URI & (PHISHING | CRACKED_SURBL | PH_SURBL_MULTI | DBL_PHISH | DBL_ABUSE_PHISH | URIBL_BLACK | PHISHED_OPENPHISH | PHISHED_PHISHTANK)";
  82. description = "Phish message sent by hacked Wordpress instance";
  83. policy = "leave";
  84. }
  85. COMPROMISED_ACCT_BULK {
  86. expression = "(HAS_XOIP | RCVD_FROM_SMTP_AUTH) & DCC_BULK";
  87. description = "Likely to be from a compromised account";
  88. score = 3.0;
  89. policy = "leave";
  90. }
  91. UNDISC_RCPTS_BULK {
  92. expression = "DCC_BULK & (MISSING_TO | R_UNDISC_RCPT)";
  93. description = "Missing or undisclosed recipients with a bulk signature";
  94. score = 3.0;
  95. policy = "leave";
  96. }
  97. RCVD_UNAUTH_PBL {
  98. expression = "RECEIVED_SPAMHAUS_PBL & !RCVD_VIA_SMTP_AUTH";
  99. description = "Relayed through Spamhaus PBL IP without sufficient authentication (possibly indicating an open relay)";
  100. score = 2.0;
  101. policy = "leave";
  102. }
  103. RCVD_DKIM_ARC_DNSWL_MED {
  104. expression = "(R_DKIM_ALLOW | ARC_ALLOW) & RCVD_IN_DNSWL_MED";
  105. description = "Sufficiently DKIM/ARC signed and received from IP with medium trust at DNSWL";
  106. score = -0.5;
  107. policy = "leave";
  108. }
  109. RCVD_DKIM_ARC_DNSWL_HI {
  110. expression = "(R_DKIM_ALLOW | ARC_ALLOW) & RCVD_IN_DNSWL_HI";
  111. description = "Sufficiently DKIM/ARC signed and received from IP with high trust at DNSWL";
  112. score = -1.0;
  113. policy = "leave";
  114. }
  115. AUTOGEN_PHP_SPAMMY {
  116. expression = "(HAS_X_POS | HAS_PHPMAILER_SIG | HAS_X_PHP_SCRIPT) & (SUBJECT_ENDS_QUESTION | SUBJECT_ENDS_EXCLAIM | MANY_INVISIBLE_PARTS)";
  117. description = "Message was generated by PHP script and contains some spam indicators";
  118. score = 1.0;
  119. policy = "leave";
  120. }
  121. PHISH_EMOTION {
  122. expression = "(PHISHING | DBL_PHISH | PHISHED_OPENPHISH | PHISHED_PHISHTANK) & (SUBJECT_ENDS_QUESTION | SUBJECT_ENDS_EXCLAIM)";
  123. description = "Phish message with subject trying to address users emotion";
  124. score = 1.0;
  125. policy = "leave";
  126. }
  127. HAS_ANON_DOMAIN {
  128. expression = "HAS_GUC_PROXY_URI | URIBL_RED | DBL_ABUSE_REDIR | HAS_ONION_URI";
  129. description = "Contains one or more domains trying to disguise owner/destination";
  130. score = 0.1;
  131. policy = "leave";
  132. }
  133. BAD_REP_POLICIES {
  134. description = "Contains valid policies but are also marked by fuzzy/bayes/SURBL/RBL";
  135. expression = "(~g-:policies) & (-g+:fuzzy | -g+:statistics | -g+:surbl | -g+:rbl)";
  136. score = 0.1;
  137. }
  138. VIOLATED_DIRECT_SPF {
  139. description = "Has no Received (or no trusted received relays) and SPF policy fails or soft fails";
  140. expression = "(R_SPF_FAIL | R_SPF_SOFTFAIL) & (RCVD_COUNT_ZERO | RCVD_NO_TLS_LAST)";
  141. policy = "leave";
  142. score = 3.5;
  143. }
  144. IP_SCORE_FREEMAIL {
  145. description = "Negate IP_SCORE when message comes from FreeMail";
  146. expression = "FREEMAIL_FROM & SENDER_REP_SPAM";
  147. score = 0.0;
  148. policy = "remove_weight";
  149. }
  150. BROKEN_HEADERS_MAILLIST {
  151. description = "Negate BROKEN_HEADERS when message comes via some mailing list";
  152. expression = "BROKEN_HEADERS & -MAILLIST";
  153. score = 0.0;
  154. policy = "remove_weight";
  155. }
  156. LEAKED_PASSWORD_SCAM {
  157. description = "Contains BTC wallet address and scam patterns";
  158. expression = "BITCOIN_ADDR & (LEAKED_PASSWORD_SCAM_RE | R_MIXED_CHARSET | R_EMPTY_IMAGE)";
  159. policy = "leave";
  160. score = 7.0;
  161. group = "scams";
  162. }
  163. FREEMAIL_AFF {
  164. expression = "(FREEMAIL_FROM | FREEMAIL_ENVFROM | FREEMAIL_REPLYTO) & (TO_DN_RECIPIENTS | R_UNDISC_RCPT) & (INTRODUCTION | FROM_NAME_HAS_TITLE | FREEMAIL_REPLYTO_NEQ_FROM_DOM | SUBJECT_HAS_CURRENCY)";
  165. score = 4.0;
  166. policy = "leave";
  167. description = "Message exhibits strong characteristics of advance fee fraud (AFF a/k/a '419' spam) involving freemail addresses";
  168. }
  169. REDIRECTOR_URL_ONLY {
  170. expression = "HFILTER_URL_ONLY & REDIRECTOR_URL";
  171. score = 1.0;
  172. policy = "leave";
  173. description = "Message only contains a redirector URL";
  174. }
  175. THREAD_HIJACKING_FROM_INJECTOR {
  176. expression = "FAKE_REPLY & RCVD_VIA_SMTP_AUTH & (!RECEIVED_SPAMHAUS_PBL | RECEIVED_SPAMHAUS_XBL | RECEIVED_SPAMHAUS_SBL)";
  177. score = 2.0;
  178. policy = "leave";
  179. description = "Fake reply exhibiting characteristics of being injected into a compromised mail server, possibly e-mail thread hijacking";
  180. group = "compromised_hosts";
  181. }
  182. SUSPICIOUS_URL_IN_SUSPICIOUS_MESSAGE {
  183. expression = "(REDIRECTOR_URL | HAS_ANON_DOMAIN | HAS_IPFS_GATEWAY_URL) & (-g+:fuzzy | -g+:statistics | -g+:surbl | -g+:rbl)";
  184. score = 1.0;
  185. policy = "leave";
  186. description = "Message contains redirector, anonymous or IPFS gateway URL and is marked by fuzzy/bayes/SURBL/RBL";
  187. }
  188. .include(try=true; priority=1; duplicate=merge) "$LOCAL_CONFDIR/local.d/composites.conf"
  189. .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/composites.conf"
  190. }