14 messages in net.sourceforge.lists.courier-maildropRE: [maildropl] Re: syntax problem (d...
FromSent OnAttachments
Benjamin TomhaveApr 9, 2003 3:23 pm 
Sam VarshavchikApr 9, 2003 3:49 pm 
Benjamin TomhaveApr 10, 2003 8:25 am 
Sam VarshavchikApr 10, 2003 8:48 am 
Benjamin TomhaveApr 10, 2003 9:28 am 
Sam VarshavchikApr 10, 2003 10:09 am 
Devin RubiaApr 10, 2003 10:19 am 
Benjamin TomhaveApr 10, 2003 11:14 am 
Benjamin TomhaveApr 10, 2003 11:15 am 
Rolan YangApr 10, 2003 11:22 am 
Benjamin TomhaveApr 10, 2003 11:44 am 
Devin RubiaApr 11, 2003 6:04 am 
Fernando La GambaApr 14, 2003 12:40 pm 
Gatis GailisApr 14, 2003 1:46 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] Re: syntax problem (did something change from 1.3.8 to 1.5.2?)Actions...
From:Benjamin Tomhave (btom@sofast.net)
Date:Apr 10, 2003 8:25:48 am
List:net.sourceforge.lists.courier-maildrop

Ok, I'm confused...according to the maildropfilter man page, if you put a command within backticks, then RETURNCODE is set to the returned value. Is this not the case? I did go ahead and modify my code to read:

DUMMY=`test -d $VHOME/Maildir` if ( $DUMMY == 1 ) ...

I did that for both of the test lines. However, even though the folder was present, it concluded that the folder was not present (which perhaps means my VHOME var isn't receiveing a value). Time to setup the logfile to check that, I guess.

If I want to execute commands within an IF statement, how do I do that? When I removed the backticks I received a syntax error again. I don't need these commands to return values, I just need them to execute if the IF statement expression is true.

-----Original Message----- From: cour@lists.sourceforge.net [mailto:cour@lists.sourceforge.net]On Behalf Of Sam Varshavchik Sent: Wednesday, April 09, 2003 4:48 PM To: cour@lists.sourceforge.net Subject: [maildropl] Re: syntax problem (did something change from 1.3.8 to 1.5.2?)

Benjamin Tomhave writes:

---------- more elaborate test ------------- import EXT import HOST VPOP="| /home/vpopmail/bin/vdelivermail '' bounce-no-mailbox" VHOME=`/home/vpopmail/bin/vuserinfo -d $EXT@$HOST`

`test -d $VHOME/Maildir` if ( $RETURNCODE == 1 ) { echo "Sorry, no mailbox here by that name. (#5.1.1)" EXITCODE=100 exit }

`test -d $VHOME/Maildir/.Spam` if ( $RETURNCODE == 1 ) { `/usr/bin/maildirmake -f Spam $VHOME/Maildir` `echo Inbox.Spam >> $VHOME/Maildir/courierimapsubscribed` }

to "$VPOP" exit ---------- end -------------

The question, then is why do these IF statements fail?

The `...` operator runs the command, and whatever output the command generates replaces the original `...` operator.

Even if no output is produced, the result is still parsed as an empty string. Essentially, you have three lines in the script whose contents are

""

Obviously that's not a valid statement.

You need to use a dummy variable, each time

DUMMY=`...`