1 mail.filter is a program called by sendmail, that forward mails to some cyrus
4 Optionally, mail.filter use spamprobe for spam detection, and clamav for virus
5 detection. (Well, it's not really optional actually.)
7 For defining rules, see CREATING-RULES file.
10 ----------------------
12 mail.filter contains several variable definition that you should review and
18 1] Check that Python is able to run the script by running:
22 2] Try mail.filter without feeding the mail to Cyrus by running:
24 mail.filter -t -v john < somemail
26 with somemail a file containing a email you want to feed to mail.filter for
27 testing purpose. Output log should show you what action is deduced from mail
28 contents and user rules.
30 3] You can test again by removing the '-t' option to actually feed Cyrus with
31 the mail, and test if Cyrus accept the mail as expected in the right folder.
33 4] Check that sendmail can run the script (permission, sendmail restriction,..)
38 Add the following TWO lines:
41 Mmailfilter, P=/usr/sbin/mail.filter, F=lsDFMA5:/|@qSPn, A=mail.filter $u
42 define(`confLOCAL_MAILER', `mailfilter')dnl
45 in your sendmail.mc, then regenerate sendmail.cf (be carefull if sendmail.cf
46 was not in sync. with your sendmail.mc ! I suggest to generate 'm4 sendmail.cf'
47 to a different file, and use diff to see what really change.)
49 The first line define a new mailer. The second line define it as default mailer
50 for delivering mail to local system.
52 Then, you just need to restart sendmail.
57 [ ] Make spam and antivirus detection more modular, to support other antispam
58 or antiviruses program.
59 [ ] Try to create folder if Cyrus answer with unknown folder error, then
61 [ ] Add size match (really usefull?)
62 [ ] Support feature such as vacation, automatic answer, forwarding, calling
63 external script (or even "just" python module.)
64 [ ] For mail rejected by Cyrus because of invalid header, encapsulate the
65 mail into a new one, and feed this one to Cyrus (and tagged as broken.)
66 [ ] Allow mail.filter to re-file mails already present in a Cyrus folder.