[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

policydb and blank lines in smtp-policy.spam break delivery




ZMailer Server 2.99.49p8 #1 ESMTP+IDENT

A potential problem exists if the smtp-policy.spam file retrived
from  http://www.webeasy.com:8080/spam/spam_download_table has
blank lines (perhaps due to lynx variants). I encountered this 
(a blank line at both the beginning and end of the file), and this
broke policy-builder.sh (fails to run to completion).

An entry like the following may be inserted into smtp-policy.dat
just after the smtp-policy.src file contents:

...
friends@                = _bulk_mail
#----------------------------------
 = _bulk_mail
...


(space char ? resulting from a blank line)

which now prevents zmailer from accepting delivery to it's own
domain, (or for any domain for that matter):

i.e.:

...
2698r   mail from: <jmack@Phys.UAlberta.CA>
2698w   250 2.1.0 Sender syntax Ok
2698r   rcpt to: <jmack@Phys.UAlberta.CA>
2698w   453 4.7.1 Policy rejection on the target address
...

A fix is to strip out any blank lines before it builds the db file
in policy-builder.sh:

...
lynx -source http://www.webeasy.com:8080/spam/spam_download_table \
   > smtp-policy.spam.new && mv smtp-policy.spam.new smtp-policy.spam

# strip off any null lines coming from above: 
/zmailer/bin/stripnulls smtp-policy.spam tmp.spam

# Fork off a subshell to do it all...
...


And the dumb script mentioned is:

>cat /zmailer/bin/stripnulls
#!/bin/sh
# name: stripnulls
# strip nulls off a file $1 and put remainder in $2
# replace $1 with $2 when done
#
cat /dev/null > $2
for i in `cat $1` ; do
        case $i in 
        '')
        ;;
        *)
                echo $i >> $2
        ;;
        esac
done
mv $2 $1


I'm not a good shell programmer, so my hack is quite crude, but it
seems to work so far.

Matti, a better inline version could be contructed by an expert?
-especially critical to avoid corruption problems with the policydb.
There may be other problems associated with download too which could
leave the file in an un-buildable state.

Cheers,
--
James S. MacKinnon           Office: P-139 Avadh-Bhatia Physics Lab
Team Physics                 Voice : (403) 492-8226
University of Alberta        email : Jim.MacKinnon@Phys.UAlberta.CA
Edmonton, Canada T6G 2N5
        WWW:   http://www.phys.ualberta.ca/~jmack/jmack.html