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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  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. group = "compromised_hosts";
  85. }
  86. COMPROMISED_ACCT_BULK {
  87. expression = "(HAS_XOIP | RCVD_FROM_SMTP_AUTH) & DCC_BULK";
  88. description = "Likely to be from a compromised account";
  89. score = 3.0;
  90. policy = "leave";
  91. group = "compromised_hosts";
  92. }
  93. UNDISC_RCPTS_BULK {
  94. expression = "DCC_BULK & (MISSING_TO | R_UNDISC_RCPT)";
  95. description = "Missing or undisclosed recipients with a bulk signature";
  96. score = 3.0;
  97. policy = "leave";
  98. }
  99. RCVD_UNAUTH_PBL {
  100. expression = "RECEIVED_SPAMHAUS_PBL & !RCVD_VIA_SMTP_AUTH";
  101. description = "Relayed through Spamhaus PBL IP without sufficient authentication (possibly indicating an open relay)";
  102. score = 2.0;
  103. policy = "leave";
  104. }
  105. RCVD_DKIM_ARC_DNSWL_MED {
  106. expression = "(R_DKIM_ALLOW | ARC_ALLOW) & RCVD_IN_DNSWL_MED";
  107. description = "Sufficiently DKIM/ARC signed and received from IP with medium trust at DNSWL";
  108. score = -0.5;
  109. policy = "leave";
  110. }
  111. RCVD_DKIM_ARC_DNSWL_HI {
  112. expression = "(R_DKIM_ALLOW | ARC_ALLOW) & RCVD_IN_DNSWL_HI";
  113. description = "Sufficiently DKIM/ARC signed and received from IP with high trust at DNSWL";
  114. score = -1.0;
  115. policy = "leave";
  116. }
  117. AUTOGEN_PHP_SPAMMY {
  118. expression = "(HAS_X_POS | HAS_PHPMAILER_SIG | HAS_X_PHP_SCRIPT) & (SUBJECT_ENDS_QUESTION | SUBJECT_ENDS_EXCLAIM | MANY_INVISIBLE_PARTS)";
  119. description = "Message was generated by PHP script and contains some spam indicators";
  120. score = 1.0;
  121. policy = "leave";
  122. }
  123. PHISH_EMOTION {
  124. expression = "(PHISHING | DBL_PHISH | PHISHED_OPENPHISH | PHISHED_PHISHTANK) & (SUBJECT_ENDS_QUESTION | SUBJECT_ENDS_EXCLAIM)";
  125. description = "Phish message with subject trying to address users emotion";
  126. score = 1.0;
  127. policy = "leave";
  128. }
  129. HAS_ANON_DOMAIN {
  130. expression = "HAS_GUC_PROXY_URI | URIBL_RED | DBL_ABUSE_REDIR | HAS_ONION_URI";
  131. description = "Contains one or more domains trying to disguise owner/destination";
  132. score = 0.1;
  133. policy = "leave";
  134. }
  135. BAD_REP_POLICIES {
  136. description = "Contains valid policies but are also marked by fuzzy/bayes/SURBL/RBL";
  137. expression = "(~g-:policies) & (-g+:fuzzy | -g+:statistics | -g+:surbl | -g+:rbl)";
  138. score = 0.1;
  139. }
  140. VIOLATED_DIRECT_SPF {
  141. description = "Has no Received (or no trusted received relays) and SPF policy fails or soft fails";
  142. expression = "(R_SPF_FAIL | R_SPF_SOFTFAIL) & (RCVD_COUNT_ZERO | RCVD_NO_TLS_LAST)";
  143. policy = "leave";
  144. score = 3.5;
  145. }
  146. IP_SCORE_FREEMAIL {
  147. description = "Negate IP_SCORE when message comes from FreeMail";
  148. expression = "FREEMAIL_FROM & SENDER_REP_SPAM";
  149. score = 0.0;
  150. policy = "remove_weight";
  151. }
  152. BROKEN_HEADERS_MAILLIST {
  153. description = "Negate BROKEN_HEADERS when message comes via some mailing list";
  154. expression = "BROKEN_HEADERS & -MAILLIST";
  155. score = 0.0;
  156. policy = "remove_weight";
  157. }
  158. LEAKED_PASSWORD_SCAM {
  159. description = "Contains BTC wallet address and scam patterns";
  160. expression = "BITCOIN_ADDR & (LEAKED_PASSWORD_SCAM_RE | R_MIXED_CHARSET | R_EMPTY_IMAGE)";
  161. policy = "leave";
  162. score = 7.0;
  163. group = "scams";
  164. }
  165. FREEMAIL_AFF {
  166. expression = "(FREEMAIL_FROM | FREEMAIL_ENVFROM | FREEMAIL_REPLYTO | FREEMAIL_MDN) & (TO_DN_RECIPIENTS | R_UNDISC_RCPT) & (INTRODUCTION | FROM_NAME_HAS_TITLE | FREEMAIL_REPLYTO_NEQ_FROM_DOM | SUBJECT_HAS_CURRENCY)";
  167. score = 4.0;
  168. policy = "leave";
  169. description = "Message exhibits strong characteristics of advance fee fraud (AFF a/k/a '419' spam) involving freemail addresses";
  170. group = "scams";
  171. }
  172. SUSPICIOUS_MDN {
  173. expression = "(FREEMAIL_MDN | DISPOSABLE_MDN) & !(FREEMAIL_FROM | FREEMAIL_ENVFROM)";
  174. score = 2.0;
  175. policy = "leave";
  176. description = "Message delivery notification should go to freemail or disposable e-mail, but message was not sent from a freemail address";
  177. group = "scams";
  178. }
  179. REDIRECTOR_URL_ONLY {
  180. expression = "HFILTER_URL_ONLY & REDIRECTOR_URL";
  181. score = 1.0;
  182. policy = "leave";
  183. description = "Message only contains a redirector URL";
  184. }
  185. SUSPICIOUS_AUTH_ORIGIN {
  186. expression = "(HAS_XOIP | RCVD_FROM_SMTP_AUTH) & (!RECEIVED_SPAMHAUS_PBL | RECEIVED_SPAMHAUS_XBL | RECEIVED_SPAMHAUS_SBL | RECEIVED_BLOCKLISTDE)";
  187. score = 0.0;
  188. policy = "leave";
  189. description = "Message authenticated, but from a suspicios origin (potentially an injector)";
  190. }
  191. ABUSE_FROM_INJECTOR {
  192. expression = "SUSPICIOUS_AUTH_ORIGIN & (FAKE_REPLY | HAS_IPFS_GATEWAY_URL | HTML_SHORT_LINK_IMG_1)";
  193. score = 2.0;
  194. policy = "leave";
  195. description = "Message is sent from a suspicios origin and showing signs of abuse, likely spam injected in compromised account";
  196. group = "compromised_hosts";
  197. }
  198. SUSPICIOUS_URL_IN_SUSPICIOUS_MESSAGE {
  199. expression = "(REDIRECTOR_URL | HAS_ANON_DOMAIN | HAS_IPFS_GATEWAY_URL) & (-g+:fuzzy | -g+:statistics | -g+:surbl | -g+:rbl)";
  200. score = 1.0;
  201. policy = "leave";
  202. description = "Message contains redirector, anonymous or IPFS gateway URL and is marked by fuzzy/bayes/SURBL/RBL";
  203. }
  204. .include(try=true; priority=1; duplicate=merge) "$LOCAL_CONFDIR/local.d/composites.conf"
  205. .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/composites.conf"
  206. }