123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232 |
- # .mailfilter - rules for maildrop
- HOME="/home/manu"
- MAILDIR="$HOME/Mail/imap"
- MAILDIRMAKE="/usr/bin/maildirmake"
- VERBOSE=9
- logfile "/home/manu/var/logs/maildrop/maildrop.log"
- ### RMLL Lists (2009 and previous)
- if (/^X-BeenThere:\s*(.*)@rmll\.info/)
- {
- exception {
- `test -d $MAILDIR/.rmll.09.$MATCH1`
- if( $RETURNCODE == 1 )
- `$MAILDIRMAKE $MAILDIR/.rmll.09.$MATCH1`
- to $MAILDIR/.rmll.09.$MATCH1
- }
- }
- if (/^From:.*reservation@rmll\.info/ || /^From:.*tpeweb@paybox\.com/)
- {
- to $MAILDIR/.rmll.resa
- }
- ### RMLL lists - 2010
- if (/^List-Id:.*<(.*)\.listes20(.*)\.rmll\.info>/)
- {
- exception {
- `test -d $MAILDIR/.rmll.$MATCH2.$MATCH1`
- if( $RETURNCODE == 1 )
- `$MAILDIRMAKE $MAILDIR/.rmll.$MATCH2.$MATCH1`
- to $MAILDIR/.rmll.$MATCH2.$MATCH1
- }
- }
- if (/^To:.*benevoles@rmll\.info/)
- {
- to $MAILDIR/.rmll.10
- }
- ### RMLL 2011
- if (/^List-Id:.*org2011.2011.rmll.info/)
- {
- to $MAILDIR/.rmll.11.org
- }
- ### Debian Lists
- if (/^List-Id:\s*<debian-(.*)\.lists\.debian\.org>/)
- {
- exception {
- `test -d $MAILDIR/.debian.$MATCH1`
- if( $RETURNCODE == 1 )
- `$MAILDIRMAKE $MAILDIR/.debian.$MATCH1`
- to $MAILDIR/.debian.$MATCH1
- }
- }
- if (/^List-Id:.*<backports-users\.lists\.backports\.org>/)
- {
- to $MAILDIR/.debian.backports
- }
- ### Debian France Lists
- if (/^List-Id:.*<(.*)\.france\.debian\.net>/)
- {
- to $MAILDIR/.debian-france.$MATCH1
- }
- ### Debian Alioth Projects
- if (/^List-Id:.*<(.*)\.lists\.alioth\.debian\.org>/)
- {
- exception {
- `test -d $MAILDIR/.debian.alioth.$MATCH1`
- if( $RETURNCODE == 1 )
- `$MAILDIRMAKE $MAILDIR/.debian.alioth.$MATCH1`
- to $MAILDIR/.debian.alioth.$MATCH1
- }
- }
- ### Village associatif (Solution Linux)
- if (/^List-Id:.*<(.*)\.lists\.parinux\.org>/)
- {
- to $MAILDIR/.groups.$MATCH1
- }
- ### FrNog
- if (/^List-Id: .*frnog=FRnOG\.org/)
- {
- to $MAILDIR/.groups.frnog
- }
- ### Hurd France Lists
- if (/^List-Id:.*<hurdfr\.hurdfr\.org>/)
- {
- to $MAILDIR/.groups.hurd-fr
- }
- ### Asyd Lists
- if (/^List-Id:.*mailman\.asyd\.net>/)
- {
- to $MAILDIR/.logs
- }
- if (/^List-Id:.*<(.*)\.asyd\.net>/)
- {
- to $MAILDIR/.groups.asyd_$MATCH1
- }
- ### Abul Lists
- if (/^List-Id:.*<(.*)\.abul\.org>/)
- {
- exception {
- `test -d $MAILDIR/.abul.$MATCH1`
- if( $RETURNCODE == 1 )
- `$MAILDIRMAKE $MAILDIR/.abul.$MATCH1`
- to $MAILDIR/.abul.$MATCH1
- }
- }
- ### Sud-Ouest.org Lists
- if (/^List-Id:.*<(.*)\.listes\.sud-ouest\.org>/)
- {
- exception {
- `test -d $MAILDIR/.sud-ouest.$MATCH1`
- if( $RETURNCODE == 1 )
- `$MAILDIRMAKE $MAILDIR/.sud-ouest.$MATCH1`
- to $MAILDIR/.sud-ouest.$MATCH1
- }
- }
- ### SYMPA Lists
- if (/^List-Id:.*<sympa-(.*)\.cru\.fr>/)
- {
- exception {
- `test -d $MAILDIR/.sympa.$MATCH1`
- if( $RETURNCODE == 1 )
- `$MAILDIRMAKE $MAILDIR/.sympa.$MATCH1`
- to $MAILDIR/.sympa.$MATCH1
- }
- }
- ### FDN Lists
- if (/^List-Id:.*<(.*)\.fdn\.fr>/)
- {
- exception {
- `test -d $MAILDIR/.abul.$MATCH1`
- if( $RETURNCODE == 1 )
- `$MAILDIRMAKE $MAILDIR/.fdn.$MATCH1`
- to $MAILDIR/.fdn.$MATCH1
- }
- }
- ### Aquitaine libre lists
- if (/^List-Id:.*<(.*)\.listes\.aquitaine-libre\.info>/)
- {
- exception {
- `test -d $MAILDIR/.groups.aquitaine-libre_$MATCH1`
- if( $RETURNCODE == 1 )
- `$MAILDIRMAKE $MAILDIR/.groups.aquitaine-libre_$MATCH1`
- to $MAILDIR/.groups.aquitaine-libre_$MATCH1
- }
- }
- ### WeeChat Lists
- if (/^List-Id:.*weechat-(.*)\.nongnu\.org/ || /^To:.*weechat-(.*)\.nongnu\.org/)
- {
- to $MAILDIR/.weechat.$MATCH1
- }
- ### KDE projects lists
- if (/^List-Id:.*<(.*)\.kde\.org>/)
- {
- exception {
- `test -d $MAILDIR/.kde.$MATCH1`
- if( $RETURNCODE == 1 )
- `$MAILDIRMAKE $MAILDIR/.kde.$MATCH1`
- to $MAILDIR/.kde.$MATCH1
- }
- }
- ### Sympa Stuff
- if (/^From:.*SYMPA/ || /^To:.*sympa-request@.*$/)
- {
- to $MAILDIR/.logs
- }
- ### Logs Stuff
- if (/^From:.*logcheck@/ || /^Subject:.*rkhunter/ || /^Subject:.*Logwatch for/ || /^From:.*Cron Daemon/ || /^Subject:.*shinji\..* run output/)
- {
- to $MAILDIR/.logs
- }
- ### AntiSpam
- #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
- }
- ########### TRASH ###############
- if (/^From:.*(mailandgo\.fr|optingo\.net|refleximmo\.com).*$/)
- {
- to $MAILDIR/.Trash
- }
- if (/^X-Bounce-Tracking-Info:.*/)
- {
- to $MAILDIR/.Trash
- }
- ########### INBOX ###############
- to $MAILDIR/
|