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 11:44:44 am
List:net.sourceforge.lists.courier-maildrop

Ok, so I now have the following code snippit in place, RETURNCODE is getting the desired value (notice I'm including it with the echo line), but the expression isn't working correctly? I've tried this with various sets of "" around the var or the value, but to no avail. Any ideas or suggestions re: why the expression isn't evaluating as expected?

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

-----Original Message----- From: cour@lists.sourceforge.net [mailto:cour@lists.sourceforge.net]On Behalf Of Benjamin Tomhave Sent: Thursday, April 10, 2003 12:15 PM To: Devin Rubia; cour@lists.sourceforge.net Subject: RE: [maildropl] Re: syntax problem (did something change from 1.3.8 to 1.5.2?)

Yes, I get it now, thank you. The original response from Sam said "You need to use a dummy variable, each time" which I interpreted to mean that RETURNCODE should be replaced by a different variable. It was not made at all clear that there were two separate concepts being thrown around -- that the command was not being executed w/o an assignment, and that as a result of that, no exit code was being assigned. Thank you for clarifying.

-----Original Message----- From: cour@lists.sourceforge.net [mailto:cour@lists.sourceforge.net]On Behalf Of Devin Rubia Sent: Thursday, April 10, 2003 11:20 AM To: cour@lists.sourceforge.net Subject: Re: [maildropl] Re: syntax problem (did something change from 1.3.8 to 1.5.2?)

On Thu, Apr 10, 2003 at 10:28:16AM -0600, Benjamin Tomhave wrote:

Excuse me, but WTF? That was certainly rude and not called for.

The original code was:

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

The maildropfilter man page seems to indicate that RETURNCODE should get populated with the value of the test statement. Is this the case or not, oh great master creator?

As you had suggested in your previous email, I tried assigning the test statement to a variable and testing against that variable instead of against RETURNCODE, like the following, but with the side-effect of having all messages being deferred becuase the mailbox wasn't found to exist.

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

Don't slap me in the face for being confused by your documentation.

I still don't think you are getting what Sam is saying.

Let me spell it out:

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

$RETURNCODE is set as a side effect of setting a variable to the output of a backticked command.

$DUMMY is just set to the output of the command, in this case probably just a null string. The output and the return code are two different entities.

Also, you should probably be testing for the absence of success:

DUMMY=`test -d $VHOME/Maildir` if ( $RETURNCODE != 0 )

Get it now?