|
@@ -1,129 +1,145 @@
|
|
|
-# .Mailfilter - rules for maildrop
|
|
|
+# .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.*$/)
|
|
|
+### 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/)
|
|
|
{
|
|
|
- exception {
|
|
|
- `test -d $MAILDIR/.my.ml.rmll.$MATCH2`
|
|
|
- if( $RETURNCODE == 1 )
|
|
|
- `$MAILDIRMAKE $MAILDIR/.my.ml.rmll.$MATCH2`
|
|
|
- to $MAILDIR/.my.ml.rmll.$MATCH2
|
|
|
- }
|
|
|
+ to $MAILDIR/.rmll.09.resa
|
|
|
}
|
|
|
-if (/^From:.*reservation@rmll\.info.*$/)
|
|
|
- to $MAILDIR/.my.ml.rmll.resa
|
|
|
|
|
|
### Debian Lists
|
|
|
-if (/^List-Id: <debian-!.*!\.lists\.debian\.org>.*$/)
|
|
|
+if (/^List-Id:\s*<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
|
|
|
- }
|
|
|
+ exception {
|
|
|
+ `test -d $MAILDIR/.debian.$MATCH1`
|
|
|
+ if( $RETURNCODE == 1 )
|
|
|
+ `$MAILDIRMAKE $MAILDIR/.debian.$MATCH1`
|
|
|
+ to $MAILDIR/.debian.$MATCH1
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
-## Debian backports
|
|
|
-if (/^List-Id:.*<backports-users\.lists\.backports\.org>$/)
|
|
|
- to $MAILDIR/.my.ml.debian.backports
|
|
|
+if (/^List-Id:.*<backports-users\.lists\.backports\.org>/)
|
|
|
+{
|
|
|
+ to $MAILDIR/.debian.backports
|
|
|
+}
|
|
|
|
|
|
### Debian France Lists
|
|
|
-if (/^List-Id: <!.*!\.france\.debian\.net>.*$/)
|
|
|
- to $MAILDIR/.my.ml.debian.france.$MATCH2
|
|
|
+if (/^List-Id:\s*<(.*)\.france\.debian\.net>/)
|
|
|
+{
|
|
|
+ to $MAILDIR/.debian-france.$MATCH1
|
|
|
+}
|
|
|
|
|
|
### Debian Alioth Projects
|
|
|
-if (/^List-Id: .*<pkg-phototools-devel\.lists\.alioth\.debian\.org>.*$/)
|
|
|
- to $MAILDIR/.my.soft.debian.pkg.phototools
|
|
|
+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: .*<village-assoces\.lists\.parinux\.org>.*$/)
|
|
|
- to $MAILDIR/.my.ml.village-asso
|
|
|
+if (/^List-Id:.*<(.*)\.lists\.parinux\.org>/)
|
|
|
+{
|
|
|
+ to $MAILDIR/.groups.$MATCH1
|
|
|
+}
|
|
|
|
|
|
-### Kde Lists
|
|
|
-if (/^List-Id: .*<!.*!\.kde\.org>.*$/)
|
|
|
+### FrNog
|
|
|
+if (/^List-Id: .*frnog=FRnOG\.org/)
|
|
|
{
|
|
|
- exception {
|
|
|
- `test -d $MAILDIR/.my.ml.kde.$MATCH2`
|
|
|
- if( $RETURNCODE == 1 )
|
|
|
- `$MAILDIRMAKE $MAILDIR/.my.ml.kde.$MATCH2`
|
|
|
- to $MAILDIR/.my.ml.kde.$MATCH2
|
|
|
- }
|
|
|
+ to $MAILDIR/.groups.frnog
|
|
|
}
|
|
|
|
|
|
### Hurd France Lists
|
|
|
-if (/^List-Id:.*<hurdfr\.hurdfr\.org>$/)
|
|
|
- to $MAILDIR/.my.ml.hurd.hurdfr
|
|
|
+if (/^List-Id:.*<hurdfr\.hurdfr\.org>/)
|
|
|
+{
|
|
|
+ to $MAILDIR/.groups.hurd-fr
|
|
|
+}
|
|
|
|
|
|
### Asyd Lists
|
|
|
-if (/^List-Id:.*mailman\.asyd\.net>.*$/)
|
|
|
- to $MAILDIR/
|
|
|
-
|
|
|
-if (/^List-Id:.*<!.*!\.asyd\.net>.*$/)
|
|
|
- to $MAILDIR/.my.ml.asyd.$MATCH2
|
|
|
+if (/^List-Id:.*mailman\.asyd\.net>/)
|
|
|
+{
|
|
|
+ to $MAILDIR/.logs
|
|
|
+}
|
|
|
|
|
|
-### Galette Lists
|
|
|
-if (/^List-Id:.*<galette-!.*!\.gna\.org>.*$/)
|
|
|
- to $MAILDIR/.my.soft.galette.$MATCH2
|
|
|
+if (/^List-Id:.*<(.*)\.asyd\.net>/)
|
|
|
+{
|
|
|
+ to $MAILDIR/.groups.asyd_$MATCH1
|
|
|
+}
|
|
|
|
|
|
### Abul Lists
|
|
|
-if (/^List-Id:.*<!.*!\.abul\.org>.*$/)
|
|
|
+if (/^List-Id:.*<(.*)\.abul\.org>/)
|
|
|
+{
|
|
|
+ exception {
|
|
|
+ `test -d $MAILDIR/.abul.$MATCH1`
|
|
|
+ if( $RETURNCODE == 1 )
|
|
|
+ `$MAILDIRMAKE $MAILDIR/.abul.$MATCH1`
|
|
|
+ to $MAILDIR/.abul.$MATCH1
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+### Liste RMLL 2010
|
|
|
+if (/^List-Id:.*<(.*)\.listes20(.*)\.rmll\.info>/)
|
|
|
{
|
|
|
- exception {
|
|
|
- `test -d $MAILDIR/.my.ml.abul.$MATCH2`
|
|
|
- if( $RETURNCODE == 1 )
|
|
|
- `$MAILDIRMAKE $MAILDIR/.my.ml.abul.$MATCH2`
|
|
|
- to $MAILDIR/.my.ml.abul.$MATCH2
|
|
|
- }
|
|
|
+ exception {
|
|
|
+ `test -d $MAILDIR/.rmll.$MATCH2.$MATCH1`
|
|
|
+ if( $RETURNCODE == 1 )
|
|
|
+ `$MAILDIRMAKE $MAILDIR/.rmll.$MATCH2.$MATCH1`
|
|
|
+ to $MAILDIR/.rmll.$MATCH2.$MATCH1
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
### Aquitaine libre lists
|
|
|
-if (/^List-Id:.*<!.*!\.listes\.aquitaine-libre\.info>.*$/)
|
|
|
+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
|
|
|
- }
|
|
|
+ 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/.my.soft.weechat.ml.$MATCH2
|
|
|
+if (/^List-Id:.*weechat-(.*)\.nongnu\.org/ || /^To:.*weechat-(.*)\.nongnu\.org/)
|
|
|
+{
|
|
|
+ to $MAILDIR/.weechat.$MATCH1
|
|
|
+}
|
|
|
|
|
|
### Sympa Stuff
|
|
|
if (/^From:.*SYMPA/ || /^To:.*sympa-request@.*$/)
|
|
|
{
|
|
|
- to $MAILDIR/.sys.sympa
|
|
|
+ to $MAILDIR/.logs
|
|
|
}
|
|
|
|
|
|
### Logs Stuff
|
|
|
-if (/^From:.*logcheck@/ || /^Subject:.*rkhunter/ || /^Subject:.*Logwatch for/ || /^From:.*Cron Daemon/)
|
|
|
- to $MAILDIR/.sys.reports
|
|
|
-
|
|
|
-
|
|
|
-### Tiac Info
|
|
|
-if (/^Subject:.*[tT][iI][aA][cC].*[iI][nN][fF][oO]/)
|
|
|
+if (/^From:.*logcheck@/ || /^Subject:.*rkhunter/ || /^Subject:.*Logwatch for/ || /^From:.*Cron Daemon/ || /^Subject:.*shinji\..* run output/)
|
|
|
{
|
|
|
- to $MAILDIR/.friends.tbs.tiacfooting
|
|
|
+ to $MAILDIR/.logs
|
|
|
}
|
|
|
|
|
|
### 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\""
|
|
@@ -143,7 +159,15 @@ if (/^X-Spam-Status: YES/)
|
|
|
}
|
|
|
|
|
|
if (!/^From:.*/ || /^Subject:.*\[\*\*SPAM\*\*\].*/)
|
|
|
- to $MAILDIR/.Spam
|
|
|
+{
|
|
|
+ to $MAILDIR/.Spam
|
|
|
+}
|
|
|
+
|
|
|
+########### TRASH ###############
|
|
|
+if (/^From:.*(mailandgo\.fr|optingo\.net|refleximmo\.com).*$/)
|
|
|
+{
|
|
|
+ to $MAILDIR/.Trash
|
|
|
+}
|
|
|
|
|
|
########### INBOX ###############
|
|
|
to $MAILDIR/
|