4 messages in net.sourceforge.lists.courier-maildrop[maildropl] Re: grabbing output of a ...
FromSent OnAttachments
Charles SprickmanSep 29, 2004 3:27 pm 
Devin RubiaOct 1, 2004 9:15 am 
Charles SprickmanOct 1, 2004 12:11 pm 
Charles SprickmanOct 17, 2004 3:18 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[maildropl] Re: grabbing output of a command (backticks)Actions...
From:Charles Sprickman (spo@bway.net)
Date:Oct 17, 2004 3:18:41 pm
List:net.sourceforge.lists.courier-maildrop

Sorry to pester, but I'm still stuck here... Does anyone have any suggestions?

Thanks,

Charles

Hi,

I'm using clamd-stream-client to identify viruses. So far this little snippet is working well:

if ( $SIZE < 262144 ) { VIRUS=`/usr/local/bin/clamd-stream-client -t 6 -d clamd.local` log $RETURNCODE log $VIRUS if ($RETURNCODE == 65) { `test -d ./Maildir/.Virus` if( $RETURNCODE != 0 ) { log "= CREATING VIRUSDIR" `maildirmake -f Virus ./Maildir` log "= SUBSCRIBING VIRUSDIR" `echo INBOX.Virus >> ./Maildir/courierimapsubscribed` }

to $VDIR/Maildir/.Virus } }

As you can see, I use the returncode to determine if I've got a virus or not. The clamd-stream-client program spits out the name of the virus if it detects one on fd 1 (STDOUT). From reading the maildrop docs, the line:

VIRUS=`/usr/local/bin/clamd-stream-client -t 6 -d clamd.local`

should put the output of the command (the virus name) in $VIRUS. However the log always shows that variable as empty.

What am I missing? I'd really love to have that info so I can log it, or add it to the headers or something...

Thanks,