[rbldnsd] Slightly OT: script to add to rbldnsd zone

Robin Lynn Frank rlfrank at paradigm-omega.com
Fri Jan 28 23:44:50 MSK 2005


David Landgren wrote:
> Robin Lynn Frank wrote:
>
>> I've been adapting a shell script we've been using to add such things as
>> dictionary spam, unauthorized relay attempts, hits on spamtraps, etc to
>> a postfix access map, so it can be used to add to a rbldnsd zone.
>>
>> The script sorts the IP address, but unfortunately, also sorts the  line
>> beginning: :127.0.0.4:DNSBL.  I am not a script wizard and haven't
>> figured out how to keep that line at the top of the file.  If anyone
>> knows how I can keep that line whereit belongs, I'd appreciate it.
>> Alternately, if there already is such a script available, pointing me to
>> it would avoid another reinvention of the wheel. ;-)
>>
>> Code snippet follows.
>> ######################################################
>> #edit below for the address and verbiage you wish to use
>> echo ":127.0.0.4:DNSBL. Policy restrictions (prior abuse from netblock):
>> Mail from $ is NOT accepted on this server." > /var/tmp/rbldnsd_abuse.map
>>
>>
>> cat /var/tmp/rbldnsd_abuse.map /var/tmp/rbldnsd_abuse.map
>> /var/lib/rbldns/abuse |\
>>    sort -f | uniq -i \
>>    > /var/tmp/rbldnsd_abuse.map
>
>
> Something like:
>
> (
>    echo ":127.0.0.4:DNSBL. Policy restrictions etc."
>    sort -f /var/tmp/rbldnsd_abuse
> ) | uniq -i > /var/tmp/rbldnsd_abuse.map
>
> perhaps?
>

It occurs to me that if I maintain two files, one that has the "header"
and the other that contains the IPs, then I need only sort the IPs (and
eliminate duplicates) and then make the destination file the
concatenation of the header and  sorted IPs.  Not very classy, but it
ought to work.


--
Robin Lynn Frank - Director of Operations - Paradigm-Omega, LLC
Website:   http://www.paradigm-omega.com/
RSS:       http://paradigm-omega.blogspot.com/atom.xml
Spamtraps: http://www.paradigm-omega.net/cgi-bin/custmail.cgi
=====================================================================
Its nuclear, not nucular!!!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 300 bytes
Desc: OpenPGP digital signature
Url : http://www.corpit.ru/pipermail/rbldnsd/attachments/20050128/d4ad421a/signature.pgp


More information about the rbldnsd mailing list