Integrating bogofilter with postfix

After installing bogofilter, integrating with postfix was fairly straightforward by following the steps in /usr/share/doc/bogofilter/integrating-with-postfix with minor tweaks.

The document shows you how to set up a script that will have bogofilter filter incoming mail. As identified in the bogofilter man page, you can have the result of the filter do a variety of things like add header lines with spam/non-spam ratings, add text to subject lines, automatically update your spam/non-spam dictionary, etc. I configured the script to add text to subject lines based on if bogofilter classified the mail as spam or unsure (non-spam goes through without any subject line change).

The only clarification to the integrating-with-postfix document was to make sure that the /var/spool/filter directory is owned by user filter user with permissions 0×755.

The only change to the bogofilter config in /etc/bogofilter.cf was to uncomment the “spam_subject_tag” and the “unsure_subject_tag” so those were turned on.

The /etc/postfix/master.cf file launches the necessary scripts for bogofilter as described in the integrating-with-postfix document.

Comments are closed.