filter-rules.def.rc 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  1. ## filter-rules.rc
  2. # The rules used by procmail to filter mails
  3. # ----------------------------------------------------------
  4. # Spamassassin headers
  5. # All the mails pass from spamassassin, and then get
  6. # the header, and the level for Junk is already low
  7. # e.g. X-Spam-Status: No, score=0.7 required=3.0
  8. # So for now no other regex on spamassassin rule are added
  9. # ----------------------------------------------------------
  10. # ----------------------------------------------------------
  11. # AVOIDING ENLARGE YOUR PENIS, HOT GIRLS ... FILL YOUR INBOX
  12. # ^From address spam filter rule, spam all the mails
  13. # that don't match exception
  14. # ----------------------------------------------------------
  15. :0
  16. * ! ^From:.*@.*(\.)?(lcm|pcteor1)?(\.)?mi\.infn\.it>?.*$
  17. * ! ^From:.*@.*(\.)?(fisica|studenti|msg)?(\.)?unimi\.it>?.*$
  18. * ! ^From:.*@uninsubria\.it>?$
  19. * ! ^From:.*@cern\.ch>?$
  20. * ! ^From:.*@(gmail|outlook)\.com>?$
  21. * ! ^From:.*@cert-manager\.com>?$
  22. * ! ^To:.*@lists\.debian\.org>?$
  23. * ! ^Cc:.*@lists\.debian\.org>?$
  24. * ! ^From:.*@centos\.org>?$
  25. .Junk/new
  26. # ----------------------------------------------------------
  27. # Admins, Staff, Working mails, can arrive from everyone
  28. # ----------------------------------------------------------
  29. :0
  30. * ^(To|Cc): .*<?admins@(lcm|pcteor1)\.mi\.infn\.it>?.*$
  31. {
  32. :0
  33. * ^From:.*<?gogs@(lcm|pcteor1)\.mi\.infn\.it>?.*$
  34. .Gogs/new
  35. :0
  36. * ! ^From:.*<?gogs@(lcm|pcteor1)\.mi\.infn\.it>?.*$
  37. .Admins/new
  38. }
  39. # -------------------------------------------------------
  40. # Filter Staff Log mails
  41. # -------------------------------------------------------
  42. :0
  43. * ^(To|Cc):.*<?working@(lcm|pcteor1)\.mi\.infn\.it>?$
  44. {
  45. :0
  46. * ^Subject:.*Log150.*$
  47. .Log150/new
  48. :0
  49. * ^Subject:.*LogAdmin.*$
  50. .LogAdmin/new
  51. }
  52. # ----------------------------------------------------------
  53. # Report-Log mails, can arrive only from lcm domains
  54. # ----------------------------------------------------------
  55. :0
  56. * ^From:.*@.*(\.)?(lcm|pcteor1)\.mi\.infn\.it>?.*$
  57. {
  58. :0
  59. * ^To: <?farm\.backup@(lcm|pcteor1)\.mi\.infn\.it>?$
  60. .Backup\ Born/new
  61. :0
  62. * ^To: <?staff\.newborg@(lcm|pcteor1)\.mi\.infn\.it>?$
  63. .Backup\ Newborg/new
  64. :0
  65. * ^To: <?staff\.condor@(lcm|pcteor1)\.mi\.infn\.it>?$
  66. .Condor/new
  67. :0
  68. * ^To: <?farm.logs@(lcm|pcteor1)\.mi\.infn\.it>?$
  69. .Farm\ Logs/new
  70. :0
  71. * ^To: <?farmlogwatch@(lcm|pcteor1)\.mi\.infn\.it>?$
  72. {
  73. # ---------------------------------------------------
  74. # Farm important machine Logwatch (born + galileo)
  75. # ---------------------------------------------------
  76. :0
  77. * ^From:.*@(lcm|pcteor1)\.mi\.infn\.it>?.*$
  78. .Farm\ Logwatch\ I/new
  79. # ---------------------------------------------------
  80. # Farm Queue (General + Softload) Logwatch,
  81. # separated cause ^From
  82. # root@galileo.pcteor1.mi.infn.it
  83. # ---------------------------------------------------
  84. :0
  85. * ^From:.*@galileo\.(lcm|pcteor1)\.mi\.infn\.it>?.*$
  86. .Farm\ Logwatch\ II/new
  87. }
  88. :0
  89. * ^To: <?nagioslist@(lcm|pcteor1)\.mi\.infn\.it>?$
  90. .Nagios\ Cluster\ Newborg/new
  91. :0
  92. * ^(To|Cc):.*<?lcm\.accounts@(lcm|pcteor1)\.mi\.infn\.it>?$
  93. .LCM\ Accounts/new
  94. :0
  95. * ^To: <?nagiosfarm@(lcm|pcteor1)\.mi\.infn\.it>?$
  96. .Nagios\ Farm\ Born/new
  97. :0
  98. * ^To: <?logs@(lcm|pcteor1)\.mi\.infn\.it>?$
  99. {
  100. :0
  101. * ^From:.*@(lcm|pcteor1)\.mi\.infn.it>?.*$
  102. {
  103. # -----------------------------------------------
  104. # Cluster LCM important machine Logwatch
  105. # (videof, vcf, nanos8)
  106. # -----------------------------------------------
  107. :0
  108. * ^Subject:.*Logwatch.*$
  109. .Cluster\ Logwatch\ I/new
  110. # -----------------------------------------------
  111. # Cluster LCM important machine SMART alert
  112. # (tuc, videof, vcf)
  113. # -----------------------------------------------
  114. :0
  115. * ^Subject:.*SMART.*$
  116. .Cluster\ Logs/new
  117. # -----------------------------------------------
  118. # Cron motion start night-day Logs filter
  119. # -----------------------------------------------
  120. :0
  121. * ^Subject:.*/etc/init.d/motion.*$
  122. .Motion/new
  123. # -----------------------------------------------
  124. # Fail2ban Logs filter
  125. # -----------------------------------------------
  126. :0
  127. * ^Subject:.*Log Fail2Ban.*$
  128. .Fail2Ban\ Logs/new
  129. }
  130. # ---------------------------------------------------
  131. # Special machine LCM Cluster Logwatch, SMART alert
  132. # (e.g. sheldon) separated cause ^From
  133. # root@special_name.pcteor1.mi.infn.it
  134. # ---------------------------------------------------
  135. :0
  136. * ^From:.*@.*\.(lcm|pcteor1)\.mi\.infn\.it>?.*$
  137. {
  138. # -----------------------------------------------
  139. # Cluster LCM semimportant machine Logwatch
  140. # -----------------------------------------------
  141. :0
  142. * ^Subject:.*Logwatch.*$
  143. .Cluster\ Logwatch\ II/new
  144. # -----------------------------------------------
  145. # Cluster LCM semimportant machine SMART alert
  146. # -----------------------------------------------
  147. :0
  148. * ^Subject:.*SMART.*$
  149. .Cluster\ Logs/new
  150. }
  151. }
  152. :0
  153. * ^To: <?motion@(lcm|pcteor1)\.mi\.infn\.it>?$
  154. .Motion/new
  155. :0
  156. * ^Subject:.*WARNING HOME GALILEO.*$
  157. .Quota\ Farm/new
  158. # ----------------------------------------------------------
  159. # Mail that should preferably be moved as a recipient
  160. # but no one has ever felt like it, so now they come here,
  161. # a semi INBOX (e.g. newborg pcteor1 logwatch)
  162. # ----------------------------------------------------------
  163. :0
  164. * ^To: <?root@(lcm|pcteor1)\.mi\.infn\.it>?$
  165. .Root\ pcteor1/new
  166. }
  167. # ------------------------------
  168. # Important Debian mailing lists
  169. # ------------------------------
  170. :0
  171. * ^(To|Cc): <?debian-(announce|lts-announce|news|security-announce|stable-announce|changes-digest|release).*@lists\.debian\.org>?$
  172. .Debian\ I/new
  173. # -------------------------------------
  174. # Not so important Debian mailing lists
  175. # -------------------------------------
  176. :0
  177. * ^(To|Cc): <?debian-.+@lists\.debian\.org>?$
  178. .Debian\ II/new
  179. # -------------------
  180. # Centos mailing list
  181. # -------------------
  182. :0
  183. * ^From: <?centos-announce.*@centos\.org>?$
  184. .Centos/new
  185. # -----------------------
  186. # Yeee finally my INBOX
  187. # -----------------------
  188. :0
  189. $DEFAULT