![]() However, here are two scripts that I use to train SpamAssassin's Bayesian filters. This page doesn't explain how to set up SpamAssassin, not how to configure it to suit your own needs. Note that you need to specify your username in the D-Bus/DCOP call, this is required to make use of D-Bus/DCOP in a cron job. If KMail or Kontact is not started, the D-Bus/DCOP call will silently fail. Note the use of -delete -expunge which actually deletes the spam messages from your inbox (after copying them in the spam folder), preventing the same messages to be caught by isbg at each script run. The script above simply calls isbg.py, which filters out spam messages from the remote IMAP account, and then calls KMail via D-Bus/DCOP to synchronize the account locally. Qdbus /KMail .checkAccount &> /dev/nullĭcop -user xxx kmail KMailIface checkAccount &> /dev/null isbg.py -delete -expunge -imaphost -imapuser &> /dev/null Make it executable, and set it to run every 10 minutes. Here is the script, compatible with D-Bus. But we will retrieve new messages only after filtering out spam. We will essentially replace the built-in KMail interval mail checking feature, and do it via a cron job. ![]() What we want is a script that can filter out spam messages in the remote IMAP folder, and then trigger KMail to synchronise itself. Note that if you run the script again, only new messages will be parsed. The spam messages are tagged, and moved to the spam folder you just created. The script will tell you how many messages were parsed, and how many were spam. It should check emails in your remote IMAP inbox, and will save the password. isbg.py -verbose -imaphost -imapuser -savepw Try the following, with your email server and email account as arguments. Run the script with the argument -savepw in order to see if your arguments are correct, and to save the password (encrypted). I use cached IMAP folders for my email account. In KMail, simply create the folder, and make sure that your remote IMAP account is synchronized. ![]() Simply download the python script, and put it in your home directory.įirstly, you need to create a folder called spam in your IMAP inbox. We will use isbg in a cron job to periodically check our remote IMAP inbox, and move spam messages to another folder. Unlike the normal mode of deployments for SpamAssassin, isbg does not need to be involved in mail delivery, and can run on completely different machines to where your mailbox actually is. Isbg is a script that makes it easy to scan an IMAP inbox for spam using SpamAssassin and get your spam moved to another folder. Score SUBJ_ILLEGAL_CHARS 0 Install isbg (IMAP Spam Begone) My configuration file ~/.spamassassin/user_prefs shows: required_score 5.0 Install SpamAssassinįirst, you need to install SpamAssassin. We will also see how to regularly train SpamAssassin. This how-to explains a way to get SpamAssassin to work remotely on an IMAP account, and then trigger KMail to update itself. However, it is not useable, as KMail is not able to run spam checks in the background, and the whole application freezes for a while when retrieving new emails. How to setup Spamassassin to remotely remove spam messages from an IMAP account, and trigger KMail to update its cached IMAP folders
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |