## 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): .*?.*$ { :0 * ^From:.*?.*$ .Gogs/new :0 * ! ^From:.*?.*$ .Admins/new } # ---------------------- # Filter Staff Log mails # ---------------------- :0 * ^(To|Cc):.*?$ { :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: ?$ .Backup\ Born/new :0 * ^To: ?$ .Backup\ Newborg/new :0 * ^To: ?$ .Condor/new :0 * ^To: ?$ .Farm\ Logs/new :0 * ^To: ?$ { # ------------------------------------------------ # 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: ?$ .Nagios\ Cluster\ Newborg/new :0 * ^(To|Cc):.*?$ .LCM\ Accounts/new :0 * ^To: ?$ .Nagios\ Farm\ Born/new :0 * ^To: ?$ { :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/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\ pcteor1/new } # ------------------------------ # Important Debian mailing lists # ------------------------------ :0 * ^(To|Cc): ?$ .Debian\ I/new # ------------------------------------- # Not so important Debian mailing lists # ------------------------------------- :0 * ^(To|Cc): ?$ .Debian\ II/new # ------------------- # Centos mailing list # ------------------- :0 * ^From: ?$ .Centos/new # --------------------- # Yeee finally my INBOX # --------------------- :0 $DEFAULT