123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246 |
- ## filter-rules.rc
- # The rules used by procmail to filter mails
- # --------------------------------------------------------
- # Spamassassin headers
- # All the mails pass from spamassassin, and then get
- # the header, and the level for Junk is already low
- # e.g. X-Spam-Status: No, score=0.7 required=3.0
- # So for now no other regex on spamassassin rule are added
- # --------------------------------------------------------
- # -------------------------------------------------------
- # Drop duplicated and oversize mail (@amiglietta trick)
- # * temp save mail header in a lock file using `formail`
- # and if a new mail match the same msg-id stored drop
- # otherwise pass to next rule
- # * if mail_size > 8MB drop
- # -------------------------------------------------------
- :0 Wh: msgid.lock
- | formail -D 8192 $MAILDIR/.msgid.cache
- # ----------------------------------------------------------
- # AVOIDING ENLARGE YOUR PENIS, HOT GIRLS ... FILL YOUR INBOX
- # ^From address spam filter rule, spam all the mails
- # that don't match exception
- # ----------------------------------------------------------
- :0
- * ! ^From:.*@.*(\.)?(lcm|pcteor1)?(\.)?mi\.infn\.it>?.*$
- * ! ^From:.*@.*(\.)?(fisica|studenti|msg)?(\.)?unimi\.it>?.*$
- * ! ^From:.*@uninsubria\.it>?$
- * ! ^From:.*@cern\.ch>?$
- * ! ^From:.*@(gmail|outlook)\.com>?$
- * ! ^From:.*@cert-manager\.com>?$
- * ! ^To:.*@lists\.debian\.org>?$
- * ! ^Cc:.*@lists\.debian\.org>?$
- * ! ^From:.*@centos\.org>?$
- .Junk/new
- # ------------------------------------------------------
- # Admins, Staff, Working mails, can arrive from everyone
- # ------------------------------------------------------
- :0
- * ^(To|Cc): .*<?admins@(lcm|pcteor1)\.mi\.infn\.it>?.*$
- {
- :0
- * ^From:.*<?gogs@(lcm|pcteor1)\.mi\.infn\.it>?.*$
- .Gogs/new
- :0
- * ! ^From:.*<?gogs@(lcm|pcteor1)\.mi\.infn\.it>?.*$
- .Admins/new
- }
- # ----------------------
- # Filter Staff Log mails
- # ----------------------
- :0
- * ^(To|Cc):.*<?working@(lcm|pcteor1)\.mi\.infn\.it>?$
- {
- :0
- * ^Subject:.*Log150.*$
- .Log150/new
- :0
- * ^Subject:.*LogAdmin.*$
- .LogAdmin/new
- }
- # --------------------------------------------------
- # Report-Log mails, can arrive only from lcm domains
- # --------------------------------------------------
- :0
- * ^From:.*@.*(\.)?(lcm|pcteor1)\.mi\.infn\.it>?.*$
- {
- :0
- * ^To: <?farm\.backup@(lcm|pcteor1)\.mi\.infn\.it>?$
- .Backup\ Born/new
- :0
- * ^To: <?staff\.newborg@(lcm|pcteor1)\.mi\.infn\.it>?$
- .Backup\ Newborg/new
- :0
- * ^To: <?staff\.condor@(lcm|pcteor1)\.mi\.infn\.it>?$
- .Condor/new
- :0
- * ^To: <?farm.logs@(lcm|pcteor1)\.mi\.infn\.it>?$
- .Farm\ Logs/new
- :0
- * ^To: <?farmlogwatch@(lcm|pcteor1)\.mi\.infn\.it>?$
- {
- # ------------------------------------------------
- # Farm important machine Logwatch (born + galileo)
- # ------------------------------------------------
- :0
- * ^From:.*@(lcm|pcteor1)\.mi\.infn\.it>?.*$
- .Farm\ Logwatch\ I/new
- # -----------------------------------------
- # Farm Queue (General + Softload) Logwatch,
- # separated cause ^From
- # root@galileo.pcteor1.mi.infn.it
- # -----------------------------------------
- :0
- * ^From:.*@galileo\.(lcm|pcteor1)\.mi\.infn\.it>?.*$
- .Farm\ Logwatch\ II/new
- }
- :0
- * ^To: <?nagioslist@(lcm|pcteor1)\.mi\.infn\.it>?$
- .Nagios\ Cluster\ Newborg/new
- :0
- * ^(To|Cc):.*<?lcm\.accounts@(lcm|pcteor1)\.mi\.infn\.it>?$
- .LCM\ Accounts/new
- :0
- * ^To: <?nagiosfarm@(lcm|pcteor1)\.mi\.infn\.it>?$
- .Nagios\ Farm\ Born/new
- :0
- * ^To: <?logs@(lcm|pcteor1)\.mi\.infn\.it>?$
- {
- :0
- * ^From:.*@(lcm|pcteor1)\.mi\.infn.it>?.*$
- {
- # --------------------------------------
- # Cluster LCM important machine Logwatch
- # (videof, vcf, nanos8)
- # --------------------------------------
- :0
- * ^Subject:.*Logwatch.*$
- .Cluster\ Logwatch\ I/new
- # -----------------------------------------
- # Cluster LCM important machine SMART alert
- # (tuc, videof, vcf)
- # -----------------------------------------
- :0
- * ^Subject:.*SMART.*$
- .Cluster\ Logs/new
- # ---------------------------------------
- # Cron motion start night-day Logs filter
- # ---------------------------------------
- :0
- * ^Subject:.*/etc/init.d/motion.*$
- .Motion/new
- # --------------------
- # Fail2ban Logs filter
- # --------------------
- :0
- * ^Subject:.*Log Fail2Ban.*$
- .Fail2Ban\ Logs/new
- }
- # -------------------------------------------------
- # Special machine LCM Cluster Logwatch, SMART alert
- # (e.g. sheldon) separated cause ^From
- # root@special_name.pcteor1.mi.infn.it
- # -------------------------------------------------
- :0
- * ^From:.*@.*\.(lcm|pcteor1)\.mi\.infn\.it>?.*$
- {
- # -----------------------------------------
- # Cluster LCM semimportant machine Logwatch
- # -----------------------------------------
- :0
- * ^Subject:.*Logwatch.*$
- .Cluster\ Logwatch\ II/new
- # --------------------------------------------
- # Cluster LCM semimportant machine SMART alert
- # --------------------------------------------
- :0
- * ^Subject:.*SMART.*$
- .Cluster\ Logs/new
- }
- }
- :0
- * ^To: <?motion@(lcm|pcteor1)\.mi\.infn\.it>?$
- .Motion/new
- :0
- * ^Subject:.*WARNING HOME GALILEO.*$
- .Quota\ Farm/new
- # --------------------------------------------------------
- # Mail that should preferably be moved as a recipient
- # but no one has ever felt like it, so now they come here,
- # a semi INBOX (e.g. newborg pcteor1 logwatch)
- # --------------------------------------------------------
- :0
- * ^To: <?root@(lcm|pcteor1)\.mi\.infn\.it>?$
- .Root\ pcteor1/new
- }
- # ------------------------------
- # Important Debian mailing lists
- # ------------------------------
- :0
- * ^(To|Cc): <?debian-(announce|lts-announce|news|security-announce|stable-announce|changes-digest|release).*@lists\.debian\.org>?$
- .Debian\ I/new
- # -------------------------------------
- # Not so important Debian mailing lists
- # -------------------------------------
- :0
- * ^(To|Cc): <?debian-.+@lists\.debian\.org>?$
- .Debian\ II/new
- # -------------------
- # Centos mailing list
- # -------------------
- :0
- * ^From: <?centos-announce.*@centos\.org>?$
- .Centos/new
- # ---------------------
- # Yeee finally my INBOX
- # ---------------------
- :0
- $DEFAULT
|