filter-rules.def.rc 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  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:.*@cern\.ch>?$
  19. * ! ^From:.*@(gmail|outlook)\.com>?$
  20. .Junk/new
  21. # ----------------------------------------------------------
  22. # Admins, Staff, Working mails, can arrive from everyone
  23. # ----------------------------------------------------------
  24. :0
  25. * ^(To|Cc): .*<?admins@(lcm|pcteor1)\.mi\.infn\.it>?.*$
  26. {
  27. :0
  28. * ^From:.*<?gogs@(lcm|pcteor1)\.mi\.infn\.it>?.*$
  29. .Gogs/new
  30. :0
  31. * ! ^From:.*<?gogs@(lcm|pcteor1)\.mi\.infn\.it>?.*$
  32. .Admins/new
  33. }
  34. # -------------------------------------------------------
  35. # Filter Staff Log mails
  36. # -------------------------------------------------------
  37. :0
  38. * ^(To|Cc):.*<?working@(lcm|pcteor1)\.mi\.infn\.it>?$
  39. {
  40. :0
  41. * ^Subject:.*Log150.*$
  42. .Log150/new
  43. :0
  44. * ^Subject:.*LogAdmin.*$
  45. .LogAdmin/new
  46. }
  47. # ----------------------------------------------------------
  48. # Report-Log mails, can arrive only from lcm domains
  49. # ----------------------------------------------------------
  50. :0
  51. * ^From:.*@.*(\.)?(lcm|pcteor1)\.mi\.infn\.it>?.*$
  52. {
  53. :0
  54. * ^To: <?farm\.backup@(lcm|pcteor1)\.mi\.infn\.it>?$
  55. .Backup\ Born/new
  56. :0
  57. * ^To: <?staff\.newborg@(lcm|pcteor1)\.mi\.infn\.it>?$
  58. .Backup\ Newborg/new
  59. :0
  60. * ^To: <?staff\.condor@(lcm|pcteor1)\.mi\.infn\.it>?$
  61. .Condor/new
  62. :0
  63. * ^To: <?farm.logs@(lcm|pcteor1)\.mi\.infn\.it>?$
  64. .Farm\ Logs/new
  65. :0
  66. * ^To: <?farmlogwatch@(lcm|pcteor1)\.mi\.infn\.it>?$
  67. {
  68. # ---------------------------------------------------
  69. # Farm important machine Logwatch (born + galileo)
  70. # ---------------------------------------------------
  71. :0
  72. * ^From:.*@(lcm|pcteor1)\.mi\.infn\.it>?.*$
  73. .Farm\ Logwatch\ I/new
  74. # ---------------------------------------------------
  75. # Farm Queue (General + Softload) Logwatch,
  76. # separated cause ^From
  77. # root@galileo.pcteor1.mi.infn.it
  78. # ---------------------------------------------------
  79. :0
  80. * ^From:.*@galileo\.(lcm|pcteor1)\.mi\.infn\.it>?.*$
  81. .Farm\ Logwatch\ II/new
  82. }
  83. :0
  84. * ^To: <?nagioslist@(lcm|pcteor1)\.mi\.infn\.it>?$
  85. .Nagios\ Cluster\ Newborg/new
  86. :0
  87. * ^(To|Cc):.*<?lcm\.accounts@(lcm|pcteor1)\.mi\.infn\.it>?$
  88. .LCM\ Accounts/new
  89. :0
  90. * ^To: <?nagiosfarm@(lcm|pcteor1)\.mi\.infn\.it>?$
  91. .Nagios\ Farm\ Born/new
  92. :0
  93. * ^To: <?logs@(lcm|pcteor1)\.mi\.infn\.it>?$
  94. {
  95. :0
  96. * ^From:.*@(lcm|pcteor1)\.mi\.infn.it>?.*$
  97. {
  98. # -----------------------------------------------
  99. # Cluster LCM important machine Logwatch
  100. # (videof, vcf, nanos8)
  101. # -----------------------------------------------
  102. :0
  103. * ^Subject:.*Logwatch.*$
  104. .Cluster\ Logwatch\ I/new
  105. # -----------------------------------------------
  106. # Cluster LCM important machine SMART alert
  107. # (tuc, videof, vcf)
  108. # -----------------------------------------------
  109. :0
  110. * ^Subject:.*SMART.*$
  111. .Cluster\ Logs/new
  112. # -----------------------------------------------
  113. # Cron motion start night-day Logs filter
  114. # -----------------------------------------------
  115. :0
  116. * ^Subject:.*/etc/init.d/motion.*$
  117. .Motion/new
  118. # -----------------------------------------------
  119. # Fail2ban Logs filter
  120. # -----------------------------------------------
  121. :0
  122. * ^Subject:.*Log Fail2Ban.*$
  123. .Fail2Ban\ Logs/new
  124. }
  125. # ---------------------------------------------------
  126. # Special machine LCM Cluster Logwatch, SMART alert
  127. # (e.g. sheldon) separated cause ^From
  128. # root@special_name.pcteor1.mi.infn.it
  129. # ---------------------------------------------------
  130. :0
  131. * ^From:.*@.*\.(lcm|pcteor1)\.mi\.infn\.it>?.*$
  132. {
  133. # -----------------------------------------------
  134. # Cluster LCM semimportant machine Logwatch
  135. # -----------------------------------------------
  136. :0
  137. * ^Subject:.*Logwatch.*$
  138. .Cluster\ Logwatch\ II/new
  139. # -----------------------------------------------
  140. # Cluster LCM semimportant machine SMART alert
  141. # -----------------------------------------------
  142. :0
  143. * ^Subject:.*SMART.*$
  144. .Cluster\ Logs/new
  145. }
  146. }
  147. :0
  148. * ^To: <?motion@(lcm|pcteor1)\.mi\.infn\.it>?$
  149. .Motion/new
  150. :0
  151. * ^Subject:.*WARNING HOME GALILEO.*$
  152. .Quota\ Farm/new
  153. # ----------------------------------------------------------
  154. # Mail that should preferably be moved as a recipient
  155. # but no one has ever felt like it, so now they come here,
  156. # a semi INBOX (e.g. newborg pcteor1 logwatch)
  157. # ----------------------------------------------------------
  158. :0
  159. * ^To: <?root@(lcm|pcteor1)\.mi\.infn\.it>?$
  160. .Root\ pcteor1/new
  161. }
  162. # -----------------------
  163. # Yeee finally my INBOX
  164. # -----------------------
  165. :0
  166. $DEFAULT