Mailinglist Archive: opensuse (1420 mails)

< Previous Next >
Re: [opensuse] Spamassassin and Thunderbird
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 01/21/2014 10:48 AM, Bob Williams wrote:
Long. long ago in a galaxy faraway, I used to use Spamassassin in
association with Kmail, configured using the built-in setup wizard.

Several years ago, I switched from Kmail to Thunderbird for email
collection, but I just noticed that spamd still starts up
automatically on this machine. I've also started getting more spam
here recently (must be getting through my ISPs filters) and that
started me wondering if it was possible to route my incoming mail
through spamassassin before it gets to Thunderbird. I collect my mail
from an IMAP account 'out there'.

Do I have to setup my own local IMAP server, or can Thunderbird be
configured somehow?

See my sig for system information.

Thanks,

Bob,

I run a mail server utilizing postfix/dovecot and filter main through
spamassassin which works amazingly well. I like the control this setup provides.
In my imap folder in Tbird, I have 4 additional folders:

spam
spam-learn
spam-probably
spam-unlearn

The beauty of the system is that spamassassin initially filters incoming mail
and places known-spam in 'spam', and places suspected spam in 'spam-probably'.
You simply look though and delete messages in 'spam' or move any good messages
to 'spam-unlearn'. Do the same thing for 'spam-probably'. A cron-job runs
spamassassin in learn mode on the hour and learns the tokens from the messages
in 'spam-learn' and deletes them, and run spamassassin in ham mode on
'spam-unlearn' and unlearns the tokens from the messages. spamassassin utilizes
fetchmail to read the messages in the 'spam-xxx' folders on the server. Secure
access to the server and folders is provided by ssl with fetchmail access
controlled by ssl fingerprints.

My old server setup page provides an overview of the process in a bit more
detail (though it is old and dovecot is now dovecot2).

http://www.3111skyline.com/linux/openSuSE-server.php#mail

The major parts of the config are your postfix setup which is detailed on the
page. The postfix 'mail command' allows procmail to handle mail delivery.
Thereafter your .procmailrc file is read and provides the spamassassin filtering
criteria. I currently use the attached .procmailrc, .fetchmailrc and
dovecot.conf (sanitized). The cronjobs that run on the hour are also attached.

This system has proven very effective and usually catches about 80-90% of the
stuff that makes it to /var/spool/mail. Automating the processing the
'spam-learn' and 'spam-unlearn' folders makes what happens behind the scene
virtually invisible to users. As long as they can be taught 2 things:

(1) look at 'spam' if it is spam, delete, if not, move it to spam-unlearn
(2) do the same thing for 'spam-probably'

The rest takes care of itself...

Just let me know if you have more questions...


- --
David C. Rankin, J.D.,P.E.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iEYEARECAAYFAlLnUrYACgkQZMpuZ8CyrcgM2wCfV68zkRFce6RA+0WyrHSKCHVH
Eb8Ani0+UZCa+eNSvKlxOMipX6ZSI3oR
=BXnr
-----END PGP SIGNATURE-----
auth_mechanisms = plain login
passdb {
driver = pam
}
userdb {
driver = passwd
}
service auth {
unix_listener /var/spool/postfix/private/auth {
group = postfix
mode = 0660
user = postfix
}
}
ssl_cert = </etc/ssl/certs/dovecot.pem
ssl_key = </etc/ssl/private/dovecot.pem
mail_location=mbox:~/Mail:INBOX=/var/spool/mail/%u

# example .fetchmailrc for reading mail on your.server.com (provides
spamassassin access to mail)
poll your.server.com protocol IMAP : user whoever with password whatever ssl
sslfingerprint "ED:6E:5A:7C:B3:CC:CB:68:01:6C:E1:0A:4D:4C:1D:F6"

#
# General Setup
#
PATH=/usr/bin/vendor_perl:/usr/bin:/bin:/usr/local/bin:.
MAILDIR=$HOME/Mail/
#DEFAULT=$HOME/Mail/
LOGFILE=$MAILDIR/procmail.log
VERBOSE=ON
# SpamAssassin sample procmailrc
#
# Pipe the mail through spamassassin (replace 'spamassassin' with 'spamc'
# if you use the spamc/spamd combination)
#
# The condition line ensures that only messages smaller than 250 kB
# (250 * 1024 = 256000 bytes) are processed by SpamAssassin. Most spam
# isn't bigger than a few k and working with big messages can bring
# SpamAssassin to its knees.
#
# The lock file ensures that only 1 spamassassin invocation happens
# at 1 time, to keep the load down.
#
## with 'spamassassin' executable
#:0fw: spamassassin.lock
#* < 128000
#| spamassassin
#
## with spamc
:0fw: spamc.lock
* < 256000
| spamc
#| /usr/bin/vendor_perl/spamc

# Mails with a score of 15 or higher are almost certainly spam (with 0.05%
# false positives according to rules/STATISTICS.txt). Let's put them in a
# different mbox. (This one is optional.)
:0:
* ^X-Spam-Level: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*
spam
#Mail/spam

# All mail tagged as spam (eg. with a score higher than the set threshold)
# is moved to "probably-spam".
:0:
* ^X-Spam-Status: Yes
spam-probably
#Mail/spam-probably

# Work around procmail bug: any output on stderr will cause the "F" in "From"
# to be dropped. This will re-add it.
:0
* ^^rom[ ]
{
LOG="*** Dropped F off From_ header! Fixing up. "

:0 fhw
| sed -e '1s/^/F/'
}

< Previous Next >
Follow Ups
References