- Notifications
You must be signed in to change notification settings - Fork4
Customized mailfilter config with Rspamd and Bogofilter on Uberspace 7
License
bhopmann/uberspace7-mailfilter
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
Attention: This mailfilter is intended to work for Uberspace 7 – a setup for Uberspace 6 with DSPAM and SpamAssassin can be foundhere.
This script can be used for setting up a customized mailfilter config withRspamd andBogofilter on anUberspace 7 server. Every message will be filtered by these two services: Learning false positives or false negatives is realized with Bogofilter, while Rspamd uses multiple filtering and statistical methods to generate a spam score (which is later used for filtering).Custom rules can be added too. If messages are not correctly recognized as ham, they can be manually taught as ham by setting up a passlist (one email address each line). To teach Bogofilter, in the spam folder one has to mark correctly classified spam messages as read. If messages are not marked as read or moved to another folder directly after reading or ifSILENT_NEW_SPAM
is set, nothing happens.
At this time Rspamd isn't configurable for learning on userlevel (seemanual for the actual default behavior). According to Uberspace this might change in the future...
The main goal of this filter is a more intuitive workflow with less special folders (likeLearn as Spam
andLearn as Ham
) when showing messages to Bogofilter via a customizedspam-learn
script so it can learn. This is realized by marking messages, recognized or reclassified as spam, with the headerX-Spam-Folder: YES
, which is removed for messages that are reclassified as ham. All reclassified messages will be re-delivered viamaildrop
. Finally, teaching spam or ham works like this:
- When moving a messagefrom 'Junk | Spam | Junk-E-Mail'to 'Inbox' it will be learned by Bogofilter as Ham
- When moving a messagefrom 'Inbox'to 'Junk | Spam | Junk-E-Mail' it will be learned by Bogofilter as Spam
Please Note: Only messages of the last 24 hours are interpreted byspam-learn
to prevent slow scanning due to big folders.
GetBogofilter and install it like this:
wget -O bogofilter.tar.xz https://sourceforge.net/projects/bogofilter/files/bogofilter-stable/bogofilter-1.2.5.tar.xz/download tar -xvf bogofilter.tar.xzcd bogofilter-1.2.5 ./configure --with-database=sqlite3 --prefix=$HOME make make install
(Please adapt to current bogofilter version in the future)
- Set up
.qmail
andmaildrop
before (see.qmail andmaildrop documentation for setting up) - Rename
.mailfilter
to.mailfilter-EXT
(replaceEXT
by your namespace) before. - Put the file
.mailfilter
(or.mailfilter-EXT
) and the folder.mailfilters
in the home directory of your uberspace. - Remember to set the correct file permissions:
chmod 600 ~/.mailfilter
(or.mailfilter-EXT
) - mailfilter(-EXT) logfiles can be found in
~/logs
spam-learn
goes to~/bin
(its database will later be found in~/.bogofilter
)- Remember to set the correct file permissions:
chmod 755 ~/bin/spam-learn
Addspam-learn
as a cronjob that is running once per hour:
Call crontab
crontab -e
and add this lines
# Call spam-learn hourly @hourly~/bin/spam-learn
- Custom Filter for Uberspace 6 with DSPAM and SpamAssassin
- Uberspace 7manual for filtering mails
This is work in progress, so do not hesitate to give feedback and/or provide pull requests.