~ubuntu-branches/ubuntu/lucid/bogofilter/lucid-security

« back to all changes in this revision

Viewing changes to doc/integrating-with-postfix

  • Committer: Bazaar Package Importer
  • Author(s): Bhavani Shankar
  • Date: 2009-05-06 05:41:52 UTC
  • mfrom: (1.1.11 upstream) (2.1.4 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090506054152-tgameecssbuv4np6
Tags: 1.2.0-2ubuntu1
* Merge from debian unstable, remaining changes: LP: #372497
  - don't build qdbm.
  - Don't build tokyocabinet support as it's in universe.

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
 
31
31
- Build the initial spam and non-spam databases by feeding your corpus of mail.
32
32
 
33
 
   Assuming that the files are in mbox format in /home/bogofilter, you say:
 
33
   Assuming there are two files in mbox format in /home/bogofilter, you say:
34
34
 
35
35
   # cd /home/bogofilter
36
36
   # bogofilter -d . -s < spam.mbx
49
49
        # messages truncated at the first period that is alone on a line
50
50
        # (which can happen with several kinds of messages, particularly
51
51
        # quoted-printable)
52
 
        POSTFIX="/usr/sbin/sendmail -i"
 
52
        # -G is ignored before Postfix 2.3 and tells it that the message
 
53
        # does not originate on the local system (Gateway submission),
 
54
        # so Postfix avoids some of the local expansions that can leave
 
55
        # misleading traces in headers, such as local address
 
56
        # canonicalizations.
 
57
        POSTFIX="/usr/sbin/sendmail -G -i"
53
58
        export BOGOFILTER_DIR=/home/bogofilter
54
59
 
55
60
        # Exit codes from <sysexits.h>
75
80
 
76
81
   Given a good initial corpus, it is better to have bogofilter update
77
82
   its lists based on the message classification, since it is quite
78
 
   likely to get it right.  Misclassifications will be corrected later.
 
83
   likely to get it right.  Misclassifications MUST be corrected later.
79
84
 
80
85
- Modify your /etc/postfix/master.cf to run the filter.
81
86
 
88
93
    At the end of the file, add the following two lines:
89
94
 
90
95
        filter    unix  -       n       n       -       -       pipe
91
 
            flags=R user=filter argv=/home/bogofilter/postfix-filter.sh -f ${sender} -- ${recipient}
 
96
            flags=Rq user=filter argv=/home/bogofilter/postfix-filter.sh -f ${sender} -- ${recipient}
92
97
 
93
98
- Now, every incoming message will have the header line
94
99
 
121
126
  Solaris) and the shell in /etc/passwd should be set to an invalid
122
127
  shell such as /bin/false.
123
128
 
 
129
  Arrange for users to send misclassified mail to a particular mailbox 
 
130
  and make sure that the database is updated regularly.
 
131
 
 
132
  If you cannot arrange for regular corrections, remove the "-u" from 
 
133
  the bogofilter command in the script above, and update the database 
 
134
  as the need arises by registering more mail.
 
135
 
124
136
- Make sure the script is executable
125
137
 
126
138
        # chmod +x /home/bogofilter/postfix-filter.sh