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.9KB

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