1 |
I just set it up on my machine here. |
2 |
|
3 |
Here's that whole email: |
4 |
|
5 |
|
6 |
>I've been working on making postfix and bogofilter play together. |
7 |
>I think it's working good enough to tell how I did it. I don't have procmail |
8 |
>installed, so this is how I use bogofilter without it. This is on a |
9 |
>mailserver that handles mail for a small number of users. |
10 |
> |
11 |
>1. Get postfix installed and running properly. |
12 |
> |
13 |
>2. Get bogofilter installed and running properly from the command line. |
14 |
> |
15 |
>3. Create a user, I used 'filter' as a username. This user should not be |
16 |
> able to log in, but does need a home directory. I used '/home/filter'. |
17 |
> |
18 |
>4. Put the bogofilter executable in /usr/sbin |
19 |
> |
20 |
>5. Put the following script in /usr/sbin |
21 |
> |
22 |
>#!/bin/bash |
23 |
> |
24 |
>export PATH=$PATH:/usr/sbin |
25 |
>export HOME=/home/filter |
26 |
>cd $HOME |
27 |
> |
28 |
>bogofilter -p | sendmail -i "$@" |
29 |
> |
30 |
>6. In the master.cf configuration file for postfix, find the line that looks |
31 |
>like: |
32 |
> |
33 |
>smtp inet (some other stuff) smtpd |
34 |
> |
35 |
>and add this line after it. |
36 |
> |
37 |
> -o content_filter=filter: |
38 |
> |
39 |
>Be sure to include the ':' at the end of the line. |
40 |
> |
41 |
>7. Append these lines to the end of the master.cf file: |
42 |
> |
43 |
>filter unix - n n - - pipe |
44 |
> user=filter argv=/usr/sbin/filtermail -f ${sender} -- ${recipient} |
45 |
> |
46 |
>8. Do a 'postfix reload'. |
47 |
> |
48 |
>9. Now, anything bogofilter recognizes as spam will have a header that looks |
49 |
>like: |
50 |
> |
51 |
>X-Spam-Status: Yes, tests=bogofilter |
52 |
> |
53 |
>and anything it doesn't think is spam will look like: |
54 |
> |
55 |
>X-Spam-Status: No, tests=bogofilter |
56 |
> |
57 |
>10. Even though bogofilter is now filtering your email. It doesn't know what |
58 |
>to look for to distinguish spam from real email. Create two other mail |
59 |
>accounts, one for spam and one for non-spam. Anytime you receive spam that |
60 |
>bogofilter doesn't catch, forward it to the spam address. Anytime you |
61 |
>receive good mail that bogofilter thinks is spam, forward it to the non-spam |
62 |
>address. Periodically, log on to the mail server and go to the directory |
63 |
>where the spam mails are. 'su' as the user 'filter' and do a 'cat * | |
64 |
>bogofilter -s'. Delete all the spam files. Then go to the directory where |
65 |
>the good emails are and do a 'cat * | bogofilter -h'. Then delete all the |
66 |
>good emails. Hopefully, the performance of bogofilter improves over time. |
67 |
> |
68 |
>Bogofilter has a bug where the last line is sometimes duplicated using the |
69 |
>'-p' option. |
70 |
> |
71 |
>Jim Duey |
72 |
>Intensive Systems Consulting, LLC |
73 |
>Consulting for Embedded Linux and Industrial Controls |
74 |
> |
75 |
> |
76 |
>-- |
77 |
>gentoo-dev@g.o mailing list |
78 |
> |
79 |
> |
80 |
|
81 |
|
82 |
|
83 |
|
84 |
jim wrote: |
85 |
|
86 |
>A while back, someone posted a cron script to feed spam to bogofilter. I had |
87 |
>it in my 'save' folder but it got deleted. :) Could someone repost that? |
88 |
> |
89 |
>On a related note, I didn't find any archives for the mailing list. Didn't |
90 |
>they exist previously? |
91 |
> |
92 |
>Thanks, |
93 |
>Jim |
94 |
> |
95 |
>-- |
96 |
>gentoo-dev@g.o mailing list |
97 |
> |
98 |
> |
99 |
> |
100 |
|
101 |
|
102 |
|
103 |
|
104 |
-- |
105 |
gentoo-dev@g.o mailing list |