Koozali.org: home of the SME Server

SPam Assassin whitelist location

Offline william_syd

  • *****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
Which Fields
« Reply #15 on: June 20, 2006, 11:03:41 AM »
Which header fields does a white/black list operate on ?
Regards,
William

IF I give advise.. It's only if it was me....

Offline bosco555

  • *****
  • 152
  • +0/-0
To make it easier
« Reply #16 on: August 29, 2006, 11:48:19 PM »
Hi all,

I was searching the forums because I have the same problem, and I thought that a little script might make things a bit easier.  I had a text file of white-listed domains called whitelist.txt and the script below, reads the list and adds it to the Spamassassin whitelist db, here it is:

----------------------------- C U T ----------------------------------------
# Script that reads a list of "Whitelisted" domains from a file called
# whitelist.txt and adds it to the whitelist of spamassassin.

 for line in cat whitelist.txt

        do


 db spamassassin setprop wbl.global $line White


        done

expand-template /etc/mail/spamassassin/local.cf

svc -t /service/spamd
-----------------------------------------------------------------------------

I copied the script and the whitelist.txt file in /home/e-smith/db and i then checked the /etc/mail/spamassassin/local.cf which portrayed the changes.

I might be a bit rusty with my shell scripting, so feel free to alter it or to suggest a better way.

Just thought this might be of help

Regards to all

gb

Offline jfarschman

  • *
  • 406
  • +0/-0
SPam Assassin whitelist location
« Reply #17 on: September 01, 2006, 12:22:23 AM »
This looks good... and of course work.

Simplicity.
Jay Farschman
ICQ - 60448985
jay@hitechsavvy.com

Seeker

SPam Assassin whitelist location
« Reply #18 on: October 26, 2006, 07:16:46 PM »
Quote from: "jfarschman"
CC,

  You'd do it the way I did it above:

db spamassassin setprop wbl.global *domain2.com White
expand-template /etc/mail/spamassassin/local.cf
svc -t /service/spamd


So you'd do it line by line altering only this part:

*domain2.com White

Be careful about the capital letters.


I see how to add an address but how do you remove an address?

Offline raem

  • *
  • 3,972
  • +4/-0
SPam Assassin whitelist location
« Reply #19 on: October 27, 2006, 01:12:31 AM »
Seeker

EDITED this post with the correct method using delprop

> I see how to add an address but how do you remove an address?

Say your initial config command was

db spamassassin setprop wbl.global *@*vonage.com White *domain2.com White *domain3.com Black *@domain2.com White harry@badsite.com Black fred@goodsite.com White
(all on one line)
expand-template /etc/mail/spamassassin/local.cf
svc -t /service/spamd

Then to remove fred@goodsite.com White list entry the command is

db spamassassin delprop wbl.global fred@goodsite.com White
expand-template /etc/mail/spamassassin/local.cf
svc -t /service/spamd


Until a panel is available another way to add entries is using a small script to make alterations easier and avoid mistyping

mkdir -p /opt/scripts (or your preferred location)
cd /opt/scripts
pico -w wblist
(type in the following and save)

db spamassassin setprop wbl.global *@*vonage.com White *domain2.com White *domain3.com Black *@domain2.com White harry@badsite.com Black fred@goodsite.com White
(all on one line)
expand-template /etc/mail/spamassassin/local.cf
svc -t /service/spamd

Be careful, when entering the above db command, that all entries are on the one line, you may need to edit the file after you first save it to get it formatted correctly. To prevent line wrapping use
pico -w wblist


Ctrl o to save
Ctrl x to exit

chmod u+x wblist

Then run the script to configure your white and black entries
cd /opt/scripts
./wblist
or
. /opt/scripts/wblist

Check the entries in the db are correct
db spamassassin show

In future when you need to add white or black entries, check the current entries using
db spamassassin show

edit wblist as necessary adding extra entries, and then save & run the script.
As entries added this way are additive, then you can only delete them using the delprop switch either individually or collectively

eg issue the command

db spamassassin delprop wbl.global fred@goodsite.com White
expand-template /etc/mail/spamassassin/local.cf
svc -t /service/spamd

OR

db spamassassin delprop wbl.global *@*vonage.com White *domain2.com White *domain3.com Black *@domain2.com White harry@badsite.com Black fred@goodsite.com White
(all on one line)
expand-template /etc/mail/spamassassin/local.cf
svc -t /service/spamd


at the command prompt type
db
to show usage syntax
...

Offline raem

  • *
  • 3,972
  • +4/-0
SPam Assassin whitelist location
« Reply #20 on: October 27, 2006, 01:46:43 AM »
Seeker

> I see how to add an address but how do you remove an address?
>> ....you need to re-enter the whole command, minus the entry to be removed

Sorry that advice is not correct. You need to use the delprop switch
eg
to remove fred@goodsite.com White list entry do

db spamassassin delprop wbl.global fred@goodsite.com White
expand-template /etc/mail/spamassassin/local.cf
svc -t /service/spamd

and I have revised the above post so as not to mislead future readers

type
db
to see the available usage syntax
...

Offline chris burnat

  • *****
  • 1,135
  • +2/-0
    • http://www.burnat.com
SPam Assassin whitelist location
« Reply #21 on: November 04, 2006, 03:50:33 AM »
Good information, thank you Ray and others.  Just flagging an issue I encontered.  When upgrading from vs6 to vs7, in /home/e-smith/spamassassin, you may need to add/edit
wbl.global=list  because it may just be wbl.global=

This is what happened:
[root@gateway db]# db spamassassin setprop wbl.global user@domain.com White
ERROR: You should not set a config record without a type (key was wbl.global).
[root@gateway db]# db spamassassin show
conf.global=
wbl.global=
wbl.global_to=list


[root@gateway db]# pico spamassassin   ---> add list to wbl.global=
[root@gateway db]# db spamassassin show
conf.global=
wbl.global=list
wbl.global_to=list

After this, all is fine.
- chris
If it does not work out of the box, please fill in a Bug Report @ Bugzilla (http://bugs.contribs.org)  - check: http://wiki.contribs.org/Bugzilla_Help .  Thanks.