Koozali.org: home of the SME Server

SPam Assassin whitelist location

Offline idyll

  • ****
  • 113
  • +0/-0
SPam Assassin whitelist location
« on: March 18, 2006, 10:10:46 PM »
I need to enter my whitelists from a previous 6.0.1 installation.

What is the path on the 7.0 PR 1?

thanks

regards,

patrick
...

Offline raem

  • *
  • 3,972
  • +4/-0
Re: SPam Assassin whitelist location
« Reply #1 on: March 19, 2006, 12:22:53 AM »
idyll

/home/e-smith/db/spamassassin
...

Offline idyll

  • ****
  • 113
  • +0/-0
not sure about that
« Reply #2 on: March 19, 2006, 01:13:20 AM »
Ray...thanks.

it seems /etc/mail/spamassassin is where the whitelist.cf should reside.

There is a reference to this list in the link you provided, but not a list, per say.

regards,

patrick
...

Offline raem

  • *
  • 3,972
  • +4/-0
Re: not sure about that
« Reply #3 on: March 19, 2006, 07:21:12 AM »
idyll

>.... but not a list, per say.

If there was a server manager panel for the white list entries (which there is not at present) then the whitelist entries would go into the spamassassin db.
See below for the format.
You need to put them there manually, either directly editing the spamassassin db or by using the db.... command.

When you expand templates and restart spamassassin it will read the data into /etc/mail/spamassassin/local.cf

expand-template /etc/mail/spamassassin/local.cf
svc -t /service/spamd

There are templates in /etc/e-smith/templates/etc/mail/spamassassin/local.cf that relate to this.

# DO NOT MODIFY THIS FILE.
# This file is automatically maintained by the Mitel Networks SME Server
# configuration software.  Manually editing this file may put your
# system in an unknown state.
#
# updated: Sun Mar 19 10:23:09 2006
wbl.global=list|*domain.com.au|White|footytips@triumph.com.au|Black


I tried the above just now on a sme7 test server and the white/black list functionality is working.
...

Offline idyll

  • ****
  • 113
  • +0/-0
got it
« Reply #4 on: March 19, 2006, 04:45:05 PM »
I hand edited the db file and hope a contrib finds its way into the mix as inserting this many addresses is problematic.

I appreciate the pointers. Thanks.

regards,

patrick
...

Offline jfarschman

  • *
  • 406
  • +0/-0
SPam Assassin whitelist location
« Reply #5 on: March 23, 2006, 05:42:37 AM »
Ray,

  That's good information, but I'm missing one thing.  How do I add using the db commands.  I don't know the keys.

db spamassassin set key type [prop1 val1] [prop2 val2] ...

Do you have an example to get me started?  Thanks.
Jay Farschman
ICQ - 60448985
jay@hitechsavvy.com

Offline jfarschman

  • *
  • 406
  • +0/-0
SPam Assassin whitelist location
« Reply #6 on: March 23, 2006, 05:51:20 AM »
Is it like this:

db spamassassin set wbl.global list *somedomain.com white

then;

# db spamassassin show
wbl.global=list
    *somedomain.com=white
wbl.global_to=list

I tried this and expanded the template, but it did not make an entry to /etc/mail/spamassassin/local.cf  That's probably best if I got the formatting messed up.
Jay Farschman
ICQ - 60448985
jay@hitechsavvy.com

Offline jfarschman

  • *
  • 406
  • +0/-0
SPam Assassin whitelist location
« Reply #7 on: March 23, 2006, 06:02:05 AM »
My apologies,

  It's late and I'm tired.  The proper method seems to be:

db spamassassin setprop wbl.global *@*vonage.com White
db spamassassin setprop wbl.global *domain2.com White
expand-template /etc/mail/spamassassin/local.cf
svc -t /service/spamd
Jay Farschman
ICQ - 60448985
jay@hitechsavvy.com

Offline brianr

  • *
  • 990
  • +2/-0
SPam Assassin whitelist location
« Reply #8 on: March 23, 2006, 06:42:38 AM »
Quote
svc -t /service/spamd


You are not advised to use "svc" as far as I know - better to use

/etc/rc.d/init.d/spamassassin restart

If I am wrong perhaps someone can correct it..
Brian j Read
(retired, for a second time, still got 2 installations though)
The instrument I am playing is my favourite Melodeon.
.........

Offline raem

  • *
  • 3,972
  • +4/-0
SPam Assassin whitelist location
« Reply #9 on: March 23, 2006, 08:23:46 AM »
jfarschman

You can put all the required entries into the one command eg

db spamassassin setprop wbl.global *@*vonage.com White *domain2.com White *domain3.com Black
(all on one line)

expand-template /etc/mail/spamassassin/local.cf
svc -t /service/spamd
...

Offline raem

  • *
  • 3,972
  • +4/-0
SPam Assassin whitelist location
« Reply #10 on: March 23, 2006, 08:50:07 AM »
brianr

>...You are not advised to use "svc" as far as I know...

I believe it was the "service" command that is deprecated since around sme5.6. It did not always perform everything that was required of it in all circumstances on sme server.

The "svc" program controls services monitored by supervise.
ie
svc -t /service/xxxxx
is the correct way to do it now since sme6.

although
/etc/rc.d/init.d/spamassassin restart
or the shorter
/etc/init.d/spamassassin restart
still work but svc..... is now preferred/recommended.

See
http://cr.yp.to/daemontools/svc.html
&
http://cr.yp.to/daemontools/supervise.html
...

cctmx

SPam Assassin whitelist location
« Reply #11 on: April 10, 2006, 12:54:48 PM »
thank you for this precieuses information, but to put only one address of the type:  would toto@toto.com in white list, which be the order exact?

thx  ;-)

Offline jfarschman

  • *
  • 406
  • +0/-0
SPam Assassin whitelist location
« Reply #12 on: April 10, 2006, 01:56:03 PM »
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.
Jay Farschman
ICQ - 60448985
jay@hitechsavvy.com

Offline morpheusx

  • **
  • 35
  • +0/-0
SPam Assassin whitelist location
« Reply #13 on: May 05, 2006, 05:43:11 PM »
Are there any plans for a Web interface for this? Whitelisting domains etc is a commonly requested item, but requiring mulitple steps at the command line is going to be beyond the ability of many SME admins.

Also, the spam configuration options on the email filtering page are non-intuitive and could do with a redesign. For a start, if spam sensitivity is not set to 'Custom', the two custom fields should be greyed out.

Offline jfarschman

  • *
  • 406
  • +0/-0
SPam Assassin whitelist location
« Reply #14 on: May 05, 2006, 05:56:12 PM »
Morpheus,

  Take a look at bugzilla.  There is a bug there where you should share your two cents.

http://bugs.contribs.org/show_bug.cgi?id=807
Jay Farschman
ICQ - 60448985
jay@hitechsavvy.com

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.