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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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 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. policy = "remove_weight";
  26. }
  27. SPF_FAIL_FORWARDING {
  28. expression = "g:forwarding & (R_SPF_SOFTFAIL | R_SPF_FAIL)";
  29. policy = "remove_weight";
  30. }
  31. DMARC_POLICY_ALLOW_WITH_FAILURES {
  32. expression = "DMARC_POLICY_ALLOW & (R_SPF_SOFTFAIL | R_SPF_FAIL | R_DKIM_REJECT)";
  33. policy = "remove_weight";
  34. }
  35. FORGED_RECIPIENTS_FORWARDING {
  36. expression = "FORGED_RECIPIENTS & g:forwarding";
  37. policy = "remove_weight";
  38. }
  39. FORGED_SENDER_VERP_SRS {
  40. expression = "FORGED_SENDER & (ENVFROM_PRVS | ENVFROM_VERP)";
  41. }
  42. FORGED_MUA_MAILLIST {
  43. expression = "g:mua and -MAILLIST";
  44. }
  45. RBL_SPAMHAUS_XBL_ANY {
  46. expression = "RBL_SPAMHAUS_XBL & RECEIVED_SPAMHAUS_XBL";
  47. description = "From and Received address are listed in Spamhaus XBL";
  48. }
  49. AUTH_NA {
  50. expression = "R_DKIM_NA & R_SPF_NA & DMARC_NA";
  51. score = 1.0;
  52. policy = "remove_weight";
  53. description = "Authenticating message via SPF/DKIM/DMARC not possible";
  54. }
  55. DKIM_MIXED {
  56. expression = "-R_DKIM_ALLOW & (R_DKIM_DNSFAIL | R_DKIM_PERMFAIL | R_DKIM_REJECT)"
  57. policy = "remove_weight";
  58. }
  59. MAIL_RU_MAILER_BASE64 {
  60. expression = "MAIL_RU_MAILER & (FROM_EXCESS_BASE64 | MIME_BASE64_TEXT | REPLYTO_EXCESS_BASE64 | SUBJ_EXCESS_BASE64 | TO_EXCESS_BASE64)";
  61. }
  62. YANDEX_RU_MAILER_CTYPE_MIXED_BOGUS {
  63. expression = "YANDEX_RU_MAILER & -HAS_ATTACHMENT & CTYPE_MIXED_BOGUS";
  64. }
  65. MAILER_1C_8_BASE64 {
  66. expression = "MAILER_1C_8 & (FROM_EXCESS_BASE64 | MIME_BASE64_TEXT | SUBJ_EXCESS_BASE64 | TO_EXCESS_BASE64)";
  67. }
  68. HACKED_WP_PHISHING {
  69. expression = "(HAS_X_POS | HAS_PHPMAILER_SIG) & HAS_WP_URI & (PHISHING | DBL_PHISH | PHISHED_OPENPHISH | PHISHED_PHISHTANK)";
  70. description = "Phish message sent by hacked Wordpress instance";
  71. policy = "leave";
  72. }
  73. COMPROMISED_ACCT_BULK {
  74. expression = "(HAS_XOIP | RCVD_FROM_SMTP_AUTH) & DCC_BULK";
  75. description = "Likely to be from a compromised account";
  76. score = 3.0;
  77. policy = "leave";
  78. }
  79. UNDISC_RCPTS_BULK {
  80. expression = "DCC_BULK & (MISSING_TO | R_UNDISC_RCPT)";
  81. description = "Missing or undisclosed recipients with a bulk signature";
  82. score = 3.0;
  83. policy = "leave";
  84. }
  85. RCVD_UNAUTH_PBL {
  86. expression = "RECEIVED_PBL & -RCVD_VIA_SMTP_AUTH";
  87. description = "Relayed through ZEN PBL IP without sufficient authentication (possible indicating an open relay)";
  88. score = 2.0;
  89. policy = "leave";
  90. }
  91. RCVD_DKIM_ARC_DNSWL_MED {
  92. expression = "(R_DKIM_ALLOW | ARC_ALLOW) & RCVD_IN_DNSWL_MED";
  93. description = "Sufficiently DKIM/ARC signed and received from IP with medium trust at DNSWL";
  94. score = -0.5;
  95. policy = "leave";
  96. }
  97. RCVD_DKIM_ARC_DNSWL_HI {
  98. expression = "(R_DKIM_ALLOW | ARC_ALLOW) & RCVD_IN_DNSWL_HI";
  99. description = "Sufficiently DKIM/ARC signed and received from IP with high trust at DNSWL";
  100. score = -1.0;
  101. policy = "leave";
  102. }
  103. AUTOGEN_PHP_SPAMMY {
  104. expression = "(HAS_X_POS | HAS_PHPMAILER_SIG | HAS_X_PHP_SCRIPT) & (SUBJECT_ENDS_QUESTION | SUBJECT_ENDS_EXCLAIM | MANY_INVISIBLE_PARTS)";
  105. description = "Message was generated by PHP script and contains some spam indicators";
  106. score = 1.0;
  107. }
  108. PHISH_EMOTION {
  109. expression = "(PHISHING | DBL_PHISH | PHISHED_OPENPHISH | PHISHED_PHISHTANK) & (SUBJECT_ENDS_QUESTION | SUBJECT_ENDS_EXCLAIM)";
  110. description = "Phish message with subject trying to address users emotion";
  111. score = 2.0;
  112. }
  113. HAS_ANON_DOMAIN {
  114. expression = "HAS_GUC_PROXY_URI | URIBL_RED | DBL_ABUSE_REDIR | HAS_ONION_URI";
  115. description = "Contains one or more domains trying to disguise owner/destination";
  116. score = 0.5;
  117. }
  118. BAD_REP_POLICIES {
  119. description = "Contains valid policies but are also marked by fuzzy/bayes/surbl/rbl";
  120. expression = "(~g-:policies) & (-g+:fuzzy | -g+:bayes | -g+:surbl | -g+:rbl)";
  121. score = 0.1;
  122. }
  123. .include(try=true; priority=1; duplicate=merge) "$LOCAL_CONFDIR/local.d/composites.conf"
  124. .include(try=true; priority=10) "$LOCAL_CONFDIR/override.d/composites.conf"
  125. }