Greetings:

I wish to set up spamd to use a local whitelist.txt and blacklist.txt 
and to greylist everyone else.  My problem is that spamd stutters at 
all incoming connections.

I started the daemon thus:
$ /usr/libexec/spamd -g -v

$ ps -waux | grep spamd
_spamd     468  0.0  3.0  8708  3976 ??  I      9:16AM    0:00.16 
/usr/libexec/spamd -g -v
_spamd   20585  0.0  0.3  8568   412 ??  I      9:16AM    0:00.00 
spamd: (/var/db/spamd update) (spamd)
_spamd    3438  0.0  0.5  8620   616 ??  Is     9:16AM    0:00.32 
spamd: (pf <spamd-white> update) (spamd)

The relevant part of my pf.conf file looks like this:

table <spamd> persist
table <spamd-white> persist file "/var/mail/whitelist.txt"
rdr pass on $ext_if inet proto tcp from <spamd> to \
          $ext_if port smtp -> 127.0.0.1 port 8025
rdr pass on $ext_if inet proto tcp from !<spamd-white> to \
          $ext_if port smtp -> 127.0.0.1 port 8025

(I have tried changing this to the following, but the result is the 
same)

table <spamd-black> persist file "/var/mail/blacklist.txt"
table <spamd-white> persist file "/var/mail/whitelist.txt"
rdr pass on $ext_if inet proto tcp from <spamd-black> to \
          $ext_if port smtp -> 127.0.0.1 port 8025
rdr pass on $ext_if inet proto tcp from !<spamd-white> to \
          $ext_if port smtp -> 127.0.0.1 port 8025


And my spamd.conf file:
all:\
   :black:white:

black:\
   :black:\
   :method=file:\
   :msg="SPAM. Your address %A has sent spam within the last 24 
hours":\
   :file=/var/mail/blacklist.txt

white:\
   :white:\
   :method=file:\
   :file=/var/mail/whitelist.txt

I then ran /usr/libexec/spamd-setup and it reported no errors.

But when I try to connect from a non-blacklisted address, spamd 
stutters and I get the "250 You are about to try to deliver spam. Your 
time will be spent, for nothing." message.  Then I tried putting the IP 
I was connecting from in the whitelist.txt and I still get stuttered 
at.  However, putting the IP into the /var/db/spamd database using 
spamdb works; the connection is allowed.

$ spamdb
WHITE|69.41.171.207|||1166179280|1166179280|1169289680|1|0

The logs simply show the connections and disconnections:
$ tail /var/log/spamd
Dec 15 10:30:39 pinger spamd[7803]: listening for incoming connections.
Dec 15 10:33:49 pinger spamd[7803]: 69.94.110.70: connected (1/0)
Dec 15 10:33:56 pinger spamd[7803]: 69.94.110.70: disconnected after 7 
seconds.
Dec 15 10:39:51 pinger spamd[7803]: 69.41.171.207: connected (1/0)
Dec 15 10:40:03 pinger spamd[7803]: 69.41.171.207: disconnected after 
12 seconds.

Any help would be appreciated.

## Macros
SYN_ONLY="S/FSRA"
ext_if="rl0"
EXT_IP="85.48.224.90"
INT_IP="192.168.0.10"


## GLOBAL OPTIONS
set loginterface $ext_if
set block-policy return

## TRAFFIC NORMALIZATION
scrub in on $ext_if all fragment reassemble
scrub out on $ext_if all fragment reassemble random-id no-df

table <spamd-black> persist file "/var/mail/blacklist.txt"
table <spamd-white> persist file "/var/mail/whitelist.txt"
rdr pass on $ext_if inet proto tcp from <spamd-black> to \
          $ext_if port smtp -> 127.0.0.1 port 8025
rdr pass on $ext_if inet proto tcp from !<spamd-white> to \
          $ext_if port smtp -> 127.0.0.1 port 8025


## FILTER RULES

block all

pass quick on lo0 all

antispoof quick for $ext_if inet

sts = "{ 53, 110, 80, 22, 21, 25, 443, 143, 993, 873 8025}"
pass in log quick on $ext_if proto TCP from any to $INT_IP port $sts \
   flags $SYN_ONLY keep state

pass in on $ext_if proto tcp from any to any port > 49151 keep state

# Default UDP policy

block in log on $ext_if proto udp all
pass in quick on $ext_if proto { tcp, udp } from any to any port 53 
keep state
pass out quick on $ext_if proto { tcp, udp } from $INT_IP to any port 
53 keep state

# Default ICMP policy
pass  in log quick on $ext_if proto icmp from any to $EXT_IP keep state

pass out log quick on $ext_if from $INT_IP to any keep state

_______________________________________________
Openbsd-newbies mailing list
[email protected]
http://mailman.theapt.org/listinfo/openbsd-newbies

Reply via email to