Some interspersed new text. IMPORTANT for anybody copying scripts.

On Wed, 24 Jun 2009 05:19:07 -0700, patrick keshishian wrote:

>On Wed, Jun 24, 2009 at 4:33 AM, Rod Whitworth<glis...@witworx.com> wrote:
>> On Wed, 24 Jun 2009 07:57:16 -0300, Jose Fragoso wrote:
>>
>>>Hi,
>>>
>>>Actually, it is still there. But the format has changed
>>>and spamd is not being able to handle it because the IP
>>>address is now in the second column, like in:
>>>
>>>2009-06-24T12:28+0200 117.199.144.132
>>>
>>>So, for the time being, the best thing to do is to use
>>>wrapper script.
>>>
>>>Regards,
>>>
>>
>> Yep.
>> Some time ago I ran into probs using the okean lists and I recently was
>> bitten by this one.
>>
>> My solution was/is to set up spamd.conf to find those data by using the
>> 'file method'.
>> I do this because a failed fetch leaves the relevant filter without
>> data.
>>
>> So I have cronjobs to fetch the data and format it if necessary, as in:
>> 26 B  B  B 14 B  B  B * B  B  B  * B  B  B  * B  B  B  /root/bin/okean
>> that only needs to be updated once a day as it is slow to change.
>> and:
>> 31 B  B  B * B  B  B  * B  B  B  * B  B  B  * B  B  B  /root/bin/nixpix
>> so that:
>> 37 B  B  B * B  B  B  * B  B  B  * B  B  B  * B  B  B 
>/usr/libexec/spamd-setup
>> works properly.
>>
>> okean:
>> #!/bin/sh
>> ftp -o /var/db/china.txt http://www.okean.com/chinacidr.txt
>> ftp -o /var/db/korea.txt http://www.okean.com/koreacidr.txt
>>

THIS ONE CHANGES:
>> nixpix:
>> #!/bin/sh
>> cd /root/data
>> rm -f nixspam
>> /usr/local/bin/wget -q www.openbsd.org/spamd/nixspam.gz
>> if [ $? -eq 0 ] ; then
>> B  B  B  B gunzip nixspam.gz
>> B  B  B  B cut -d " " -f 2 nixspam >/var/db/nixspam
>> fi
>> exit
The cut line now becomes: 
        cut -d " " -f 1 nixspam >/var/db/nixspam
because the format has reverted to having the IP address in the first
field.

>>
>> spamd.conf points at the outputs of those scripts.
>>
>> If any of those fetches fails, the previous data is still in place to
>> maintain spamd when it runs each hour.
>
>Umm... you are explicitly doing and 'rm -f nixspam' in your script before
>wget.

Yes. Note that the operation is taking place in /root/data/ and the
output goes to /var/db/ so I am not killing my list that is used by
spamd-setup. Easy to miss when you didn't write it ;-)
I could have done wget with a -O <filename> I suppose, but I chose not
to. I'd really rather ftp the file but it is not available that way.
>
>--patrick
>
Rod/


*** NOTE *** Please DO NOT CC me. I <am> subscribed to the list.
Mail to the sender address that does not originate at the list server is 
tarpitted. The reply-to: address is provided for those who feel compelled to 
reply off list. Thankyou.

Rod/
/earth: write failed, file system is full
cp: /earth/creatures: No space left on device

Reply via email to