4 messages in net.sourceforge.lists.courier-maildropRe: [maildropl] 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:Re: [maildropl] grabbing output of a command (backticks)Actions...
From:Devin Rubia (dev@thezone.net)
Date:Oct 1, 2004 9:15:41 am
List:net.sourceforge.lists.courier-maildrop

On Wed, Sep 29, 2004 at 06:27:33PM -0400, Charles Sprickman wrote:

Hi,

I'm using clamd-stream-client to identify viruses. So far this little snippet is working well: [SNIP] 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...

Pretty simple actually. Looks like clamdscan (et al) output to stderr not stdout. Try this:

VIRUS=`/usr/local/bin/clamd-stream-client -t 6 -d clamd.local 2>&1`