I have several openbsd 4.4 boxes, all of which are running
spamd.  I have a cron job which runs a script, which has the
following commands in it:

-----
#!/bin/sh
PATH=/bin:/sbin:/usr/bin:/usr/sbin
export PATH
FIELDNUM=6
echo oldest spamdb grey entries:
spamdb | grep ^GREY | sort -t \| -k $FIELDNUM -n | head
echo
echo oldest spamdb grey entry date timestamp:
DATEINSECONDS=`spamdb | grep ^GREY | sort -t \| -k $FIELDNUM -n | head -1 | cut 
-d\| -f$FIELDNUM`
date -r $DATEINSECONDS
-----

The purpose of the script is to show me the oldest entries
in the spamdb.

This is the output (with destination domains replaced with 'domain'):

-----
oldest spamdb grey entries:                                                     
                                                    
GREY|189.62.148.55|bd3e9437.virtua.com.br|<[email protected]>|<postmas...@domain>|1257739194|1257753594|1257753594|1|0
 
GREY|209.50.235.237|yourhomejob.biz|<[email protected]>|<dwbl...@domain>|1257739196|1257753596|1257753596|2|0
               
GREY|117.4.19.147|localhost|<[email protected]>|<postmas...@domain>|1257739199|1257753599|1257753599|1|0
         
GREY|187.42.168.180|18777208209.telemar.net.br|<[email protected]>|<l...@domain>|1257739199|1257753599|1257753599|1|0
    
GREY|117.0.122.41|localhost|<[email protected]>|<te...@domain>|1257739200|1257753600|1257753600|1|0
                         
GREY|187.42.168.180|18777208209.telemar.net.br|<[email protected]>|<langu...@domain>|1257739200|1257753600|1257753600|
+1|0                                                                            
                                                    
GREY|187.42.168.180|18777208209.telemar.net.br|<[email protected]>|<langua...@domain>|1257739200|1257753600|1257753600
+|1|0                                                                           
                                                    
GREY|187.42.168.180|18777208209.telemar.net.br|<[email protected]>|<langua...@domain>|1257739201|1257753601|1257753601
+|1|0                                                                           
                                                    
GREY|187.42.168.180|18777208209.telemar.net.br|<[email protected]>|<languag...@domain>|1257739202|1257753602|125775360
+2|1|0                                                                          
                                                    
GREY|124.121.20.135|TVCMVZJBGA|<[email protected]>|<workloadbr...@domain>|1257739205|1257753605|1257753605|1|0
    
sort: fwrite: Broken pipe                                                       
                                                    
                                                                                
                                                    
oldest spamdb grey entry date timestamp:                                        
                                                    
sort: fwrite: Broken pipe                                                       
                                                    
Sun Nov  8 19:59:54 PST 2009                                                    
                                                    
-----

uname -a produces 'OpenBSD yosemite.surfutopia.net 4.4 GENERIC.MP#844 i386'

I have read the associated man pages.  I have searched the
search engines.  I was not able to find anything to try to
fix this.

I am sure this has something to do with terminals or ttys,
or something like that.  Or it could just be I am dumping
the additional data spit out by sort and sort can't handle
that, from within cron.  I am hoping this is just something
stupid I am doing wrong that is easy to fix.

Please point me in the direction to find the solution for
this issue.  Thanks in advance!

JohnM

-- 
john mendenhall
[email protected]
surf utopia
internet services

Reply via email to