.mailfilter 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. # .Mailfilter - rules for maildrop
  2. HOME="/home/manu"
  3. MAILDIR="$HOME/Mail/imap"
  4. MAILDIRMAKE="/usr/bin/maildirmake"
  5. VERBOSE=9
  6. MAILDROP_OLD_REGEXP=1
  7. logfile "/home/manu/Admin/logs/maildrop/maildrop.log"
  8. ## Listes RMLL 2008
  9. if (/^To:.*organisation@rmll2008\.org.*$/ || /^Cc:.*organisation@rmll2008\.org.*$/ || /^X-BeenThere:.*2008@rmll\.info.*$/)
  10. to $MAILDIR/.my.ml.rmll.2008
  11. #if (/^List-Id:.*![^ <]+!\.rmll\.info.*$/)
  12. # to $MAILDIR/.my.ml.rmll.$MATCH2
  13. if (/^List-Id:.*2008\.rmll\.info.*$/)
  14. to $MAILDIR/.my.ml.rmll.2008
  15. if (/^List-Id:.*org\.rmll\.info.*$/)
  16. to $MAILDIR/.my.ml.rmll.org
  17. if (/^List-Id:.*themes\.rmll\.info.*$/)
  18. to $MAILDIR/.my.ml.rmll.themes
  19. if (/^List-Id:.*communication\.rmll\.info.*$/)
  20. to $MAILDIR/.my.ml.rmll.communication
  21. if (/^List-Id:.*partenaires\.rmll\.info.*$/)
  22. to $MAILDIR/.my.ml.rmll.partenaires
  23. if (/^List-Id:.*participants\.rmll\.info.*$/)
  24. to $MAILDIR/.my.ml.rmll.participants
  25. if (/^From:.*reservation@rmll\.info.*$/)
  26. to $MAILDIR/.my.ml.rmll.resa
  27. ## Debian backports
  28. if (/^List-Id:.*<backports-users\.lists\.backports\.org>$/)
  29. to $MAILDIR/.my.ml.debian.backports
  30. ### Debian Lists
  31. if (/^List-Id: <debian-!.*!\.lists\.debian\.org>.*$/)
  32. {
  33. exception {
  34. `test -d $MAILDIR/.my.ml.debian.$MATCH2`
  35. if( $RETURNCODE == 1 )
  36. `$MAILDIRMAKE $MAILDIR/.my.ml.debian.$MATCH2`
  37. to $MAILDIR/.my.ml.debian.$MATCH2
  38. }
  39. }
  40. ### Debian France Lists
  41. if (/^List-Id: <!.*!\.france\.debian\.net>.*$/)
  42. to $MAILDIR/.my.ml.debian.france.$MATCH2
  43. ### Debian Alioth Projects
  44. if (/^List-Id: .*<pkg-phototools-devel\.lists\.alioth\.debian\.org>.*$/)
  45. to $MAILDIR/.my.soft.debian.pkg.phototools
  46. ### Hurd France Lists
  47. if (/^List-Id:.*<hurdfr\.hurdfr\.org>$/)
  48. to $MAILDIR/.my.ml.hurd.hurdfr
  49. ### Asyd Lists
  50. if (/^List-Id:.*mailman\.asyd\.net>.*$/)
  51. to $MAILDIR/
  52. if (/^List-Id:.*<!.*!\.asyd\.net>.*$/)
  53. to $MAILDIR/.my.ml.asyd.$MATCH2
  54. ### Galette Lists
  55. if (/^List-Id:.*<galette-!.*!\.gna\.org>.*$/)
  56. to $MAILDIR/.my.soft.galette.$MATCH2
  57. ### Abul Lists
  58. if (/^List-Id:.*<!.*!\.abul\.org>.*$/)
  59. {
  60. exception {
  61. `test -d $MAILDIR/.my.ml.abul.$MATCH2`
  62. if( $RETURNCODE == 1 )
  63. `$MAILDIRMAKE $MAILDIR/.my.ml.abul.$MATCH2`
  64. to $MAILDIR/.my.ml.abul.$MATCH2
  65. }
  66. }
  67. ### WeeChat Lists
  68. if (/^List-Id:.*weechat-!.*!\.nongnu\.org.*$/ || /^To:.*weechat-!.*!\.nongnu.org\.*$/)
  69. to $MAILDIR/.my.soft.weechat.ml.$MATCH2
  70. ### Sympa Stuff
  71. if (/^From:.*SYMPA/)
  72. {
  73. to $MAILDIR/.sys.sympa
  74. }
  75. ### Logs Stuff
  76. if (/^From:.*logcheck@/ || /^Subject:.*rkhunter/)
  77. to $MAILDIR/.sys.reports
  78. ### Tiac Info
  79. if (/^Subject:.*[tT][iI][aA][cC].*[iI][nN][fF][oO]/)
  80. {
  81. to $MAILDIR/.friends.tbs.tiacfooting
  82. }
  83. ### Spam
  84. CRMSCORE=`grep -a -v "^X-CRM114" | crm -u $HOME/.crm/ /usr/share/crm114/mailfilter.crm --stats_only`
  85. xfilter "formail -I \"X-CRM114-Score: $CRMSCORE\""
  86. if ($CRMSCORE < -1)
  87. {
  88. xfilter "formail -I \"X-CRM114-Spam: yes\""
  89. }
  90. log "Spam: $CRMSCORE"
  91. #if (/^X-CRM114-Spam: yes/)
  92. #{
  93. # to $MAILDIR/.Spam
  94. #}
  95. #xfilter "spamc"
  96. if (/^X-Spam-Status: YES/)
  97. {
  98. to $MAILDIR/.Spam
  99. }
  100. #if (!/^From:.*/ || /^Subject:.*[??SPAM??].*/)
  101. # to $MAILDIR/.Spam
  102. ########### INBOX ###############
  103. to $MAILDIR/