I’m running a Postfix server here at home to process incoming mail. To integrate spam filtering I’m delivering mails via procmail - it’s as simple as setting
mailbox_command = /usr/bin/procmail in postfix’
Spam filtering works by invoking the filter (bogofilter in my case) from procmail like this:
:0 fw | /usr/bin/bogofilter -uep
This command will pipe the mail content through bogofilter which will add a
X-Bogosity header denoting the spam status of the mail.
A second procmail rule moves all spam to a designated spam folder on my IMAP server:
:0 * ^X-Bogosity: Spam.* $HOME/.maildir/.INBOX.Spam/
For training I use two designated folders on my IMAP server: LearnSpam and LearnGood. I’m simply moving mails that I want to train as spam to the LearnSpam folder. Once per hour I train spam/good mails using this script:
#!/bin/bash SPAM_FOLDER=$HOME/.maildir/.INBOX.Spam.LearnSpam if [[ -d $SPAM_FOLDER ]]; then SPAM_CUR=$SPAM_FOLDER/cur # only invoke bogofilter if there are mails in the folder if [[ "$(ls -A $SPAM_CUR)" ]]; then /usr/bin/bogofilter -s -B $SPAM_FOLDER && rm $SPAM_CUR/* fi fi HAM_FOLDER=$HOME/.maildir/.INBOX.Spam.LearnGood if [[ -d $HAM_FOLDER ]]; then HAM_CUR=$HAM_FOLDER/cur # only invoke bogofilter if there are mails in the folder if [[ "$(ls -A $HAM_CUR)" ]]; then /usr/bin/bogofilter -n -B $HAM_FOLDER && rm $HAM_CUR/* fi fi
The script is invoked via cron.
Fixing the dreaded “problem with defaults entries” in debian
Quite unrelatedly my boss kept nagging me about incoming emails to root that looked like this
Subject: *** SECURITY information for <host> *** <host> : Sep 29 05:45 …
Chromecasting using a custom Chromium build
Setting up a software RAID1
Genkernel with virtio drivers
Enabling “Show in System Explorer” in Eclipse on Linux
On my Gentoo machine the “Show in System Explorer” menu item did not work on Eclipse. I kept getting this error message:
Execution of 'dbus-send --print-reply --dest=org.freedesktop.FileManager1 /org/freedesktop/FileManager1 org.freedesktop.FileManager1.ShowItems array:string:"file:/tmp/HelloWorld.java" string:""' failed with return code: 1
A …read more
Linux Mint update from 17.2 to 17.3
At work we use Linux Mint for some virtual machines that need a desktop environment. Recently, the Linux Mint project released a fairly major update to 17.3. At fist, they did not offer an update for an existing system but promised to release that laster.
Now, a good while …read more
speeding up portage’s metadata cache
Gentoo’s portage keeps metadata about installed ebuilds in
/var/cache/edb. Dependency info for all installed ebuilds is in a
dep subdirectory which typically looks something like this:
. ├── usr │ └── portage │ ├── app-admin │ │ ├── eselect-1.4.1 │ │ ├── eselect-lib-bin-symlink-0.1.1 │ │ ├── eselect-opengl-1.2.7 │ │ ├── gamin-0.1.10-r1 │ │ ├── logrotate-3.8.7 │ │ └── perl-cleaner-2.16 ...
When …read more
exaile vs. gstreamer
Exaile depends on gstreamer - albeit not on the latest version but on the 0.10 version line. Since Gentoo supports slotted …read more