NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: whitelisting with spamd

On Fri, 5 Apr 2013 12:21:24 -0500 (CDT)
"Jeremy C. Reed" <> wrote:

> On Fri, 5 Apr 2013, James K. Lowden wrote:
> > The problem is that the whitelist /etc/pf/whitelist.txt is never
> > updated.  The spamd man page says the whitelist should
> > be /var/db/spamd, but that file doesn't exist: 
> What happens when you run "spamdb"?

$ spamdb | grep  ^WHITE | wc -l

> (Do you have a custom VARBASE and installed using pkgsrc?)

Mirabile dictu, it's just an old documentation fault.  There is a file,
and it is being updated, see below.  I'm a little less confused

Looking over the docs yet again, there seem to be two whitelists:

1.  The tuples released from the greylist by spamd.  These are kept in
the pf table "spamd"?  On my machine that turns out to be
in /var/pkg/db/spamd.  They also expire after some time.  The default
is 36 days.  I don't override that.  

2.  A static list of addresses provided to pf, kept in the pf table
"spamd-white". On my machine this list is configured to be

> $ sed -ne'/spamd/,/^$/p' /etc/pf.conf 
> # spamd
> table <spamd> persist
> table <spamd-white> persist file "/etc/pf/whitelist.txt"
> rdr pass on $external inet proto tcp from <spamd> to any \
>     port smtp -> port spamd
> rdr pass on $external inet proto tcp from !<spamd-white> to any \
>     port smtp -> port spamd

If that's right, then my task is to grab whitelisted sending addresses
from #1 (using, say, spamdb and awk) and add them to #2 (say, once a
day) and tickle pf with something like

        $ pfctl -t spamd-white -T replace /etc/pf/whitelist.txt

Is that the story? 

Details follow.  Thanks for your help.  


$ strings /usr/pkg/sbin/spamdb  | grep /

$ man spamd | grep /var
           daemon.err;daemon.warn;      /var/log/spamd
     /var/db/spamd              Greylisting database.

$ file /var/pkg/db/spamd
/var/pkg/db/spamd: Berkeley DB 1.85/1.86 (Btree, version 3, native

$ ls -l  /var/pkg/db/spamd
-rw-r--r--  1 _spamd  _spamd  1622016 Apr  5 16:27 /var/pkg/db/spamd

Home | Main Index | Thread Index | Old Index