123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- # .Mailfilter - rules for maildrop
- HOME="/home/manu"
- MAILDIR="$HOME/Mail/imap"
- MAILDIRMAKE="/usr/bin/maildirmake"
- VERBOSE=9
- MAILDROP_OLD_REGEXP=1
- logfile "/home/manu/var/logs/maildrop/maildrop.log"
- ### Rmll Lists
- if (/^X-BeenThere: !.*!@rmll\.info.*$/)
- {
- exception {
- `test -d $MAILDIR/.my.ml.rmll.$MATCH2`
- if( $RETURNCODE == 1 )
- `$MAILDIRMAKE $MAILDIR/.my.ml.rmll.$MATCH2`
- to $MAILDIR/.my.ml.rmll.$MATCH2
- }
- }
- if (/^From:.*reservation@rmll\.info.*$/)
- to $MAILDIR/.my.ml.rmll.resa
- ### Debian Lists
- if (/^List-Id: <debian-!.*!\.lists\.debian\.org>.*$/)
- {
- exception {
- `test -d $MAILDIR/.my.ml.debian.$MATCH2`
- if( $RETURNCODE == 1 )
- `$MAILDIRMAKE $MAILDIR/.my.ml.debian.$MATCH2`
- to $MAILDIR/.my.ml.debian.$MATCH2
- }
- }
- ## Debian backports
- if (/^List-Id:.*<backports-users\.lists\.backports\.org>$/)
- to $MAILDIR/.my.ml.debian.backports
- ### Debian France Lists
- if (/^List-Id: <!.*!\.france\.debian\.net>.*$/)
- to $MAILDIR/.my.ml.debian.france.$MATCH2
- ### Debian Alioth Projects
- if (/^List-Id: .*<pkg-phototools-devel\.lists\.alioth\.debian\.org>.*$/)
- to $MAILDIR/.my.soft.debian.pkg.phototools
- ### Village associatif (Solution Linux)
- if (/^List-Id: .*<village-assoces\.lists\.parinux\.org>.*$/)
- to $MAILDIR/.my.ml.village-asso
- ### Kde Lists
- if (/^List-Id: .*<!.*!\.kde\.org>.*$/)
- {
- exception {
- `test -d $MAILDIR/.my.ml.kde.$MATCH2`
- if( $RETURNCODE == 1 )
- `$MAILDIRMAKE $MAILDIR/.my.ml.kde.$MATCH2`
- to $MAILDIR/.my.ml.kde.$MATCH2
- }
- }
- ### Hurd France Lists
- if (/^List-Id:.*<hurdfr\.hurdfr\.org>$/)
- to $MAILDIR/.my.ml.hurd.hurdfr
- ### Asyd Lists
- if (/^List-Id:.*mailman\.asyd\.net>.*$/)
- to $MAILDIR/
- if (/^List-Id:.*<!.*!\.asyd\.net>.*$/)
- to $MAILDIR/.my.ml.asyd.$MATCH2
- ### Galette Lists
- if (/^List-Id:.*<galette-!.*!\.gna\.org>.*$/)
- to $MAILDIR/.my.soft.galette.$MATCH2
- ### Abul Lists
- if (/^List-Id:.*<!.*!\.abul\.org>.*$/)
- {
- exception {
- `test -d $MAILDIR/.my.ml.abul.$MATCH2`
- if( $RETURNCODE == 1 )
- `$MAILDIRMAKE $MAILDIR/.my.ml.abul.$MATCH2`
- to $MAILDIR/.my.ml.abul.$MATCH2
- }
- }
- ### Aquitaine libre lists
- if (/^List-Id:.*<!.*!\.listes\.aquitaine-libre\.info>.*$/)
- {
- exception {
- `test -d $MAILDIR/.my.ml.al.$MATCH2`
- if( $RETURNCODE == 1 )
- `$MAILDIRMAKE $MAILDIR/.my.ml.al.$MATCH2`
- to $MAILDIR/.my.ml.al.$MATCH2
- }
- }
- ### WeeChat Lists
- if (/^List-Id:.*weechat-!.*!\.nongnu\.org.*$/ || /^To:.*weechat-!.*!\.nongnu.org\.*$/)
- to $MAILDIR/.my.soft.weechat.ml.$MATCH2
- ### Sympa Stuff
- if (/^From:.*SYMPA/)
- {
- to $MAILDIR/.sys.sympa
- }
- ### Logs Stuff
- if (/^From:.*logcheck@/ || /^Subject:.*rkhunter/ || /^Subject:.*Logwatch for/)
- to $MAILDIR/.sys.reports
- ### Tiac Info
- if (/^Subject:.*[tT][iI][aA][cC].*[iI][nN][fF][oO]/)
- {
- to $MAILDIR/.friends.tbs.tiacfooting
- }
- ### Spam
- CRMSCORE=`grep -a -v "^X-CRM114" | crm -u $HOME/.crm/ /usr/share/crm114/mailfilter.crm --stats_only`
- xfilter "formail -I \"X-CRM114-Score: $CRMSCORE\""
- if ($CRMSCORE < -1)
- {
- xfilter "formail -I \"X-CRM114-Spam: yes\""
- }
- #log "Spam: $CRMSCORE"
- #if (/^X-CRM114-Spam: yes/)
- #{
- # to $MAILDIR/.Spam
- #}
- #xfilter "spamc"
- if (/^X-Spam-Status: YES/)
- {
- to $MAILDIR/.Spam
- }
- if (!/^From:.*/ || /^Subject:.*\[\*\*SPAM\*\*\].*/)
- to $MAILDIR/.Spam
- ########### INBOX ###############
- to $MAILDIR/
|