

![]() | Start a set with this search |
![]() | Include this search in one of my sets |
![]() | Exclude this search from one of my sets |
![]() | Permalink to these results Paste this link in email or IM: |
| Atom feed for tracking future search results Paste this URL into your reader: |
14 messages in net.sourceforge.lists.courier-maildropRE: [maildropl] Re: syntax problem (d...| From | Sent On | Attachments |
|---|---|---|
| Benjamin Tomhave | Apr 9, 2003 3:23 pm | |
| Sam Varshavchik | Apr 9, 2003 3:49 pm | |
| Benjamin Tomhave | Apr 10, 2003 8:25 am | |
| Sam Varshavchik | Apr 10, 2003 8:48 am | |
| Benjamin Tomhave | Apr 10, 2003 9:28 am | |
| Sam Varshavchik | Apr 10, 2003 10:09 am | |
| Devin Rubia | Apr 10, 2003 10:19 am | |
| Benjamin Tomhave | Apr 10, 2003 11:14 am | |
| Benjamin Tomhave | Apr 10, 2003 11:15 am | |
| Rolan Yang | Apr 10, 2003 11:22 am | |
| Benjamin Tomhave | Apr 10, 2003 11:44 am | |
| Devin Rubia | Apr 11, 2003 6:04 am | |
| Fernando La Gamba | Apr 14, 2003 12:40 pm | |
| Gatis Gailis | Apr 14, 2003 1:46 pm |

![]() | Permalink for this message Paste this link in email or IM: |
![]() | Permalink for this thread 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=`...`
------------------------------------------------------- This SF.net email is sponsored by: Etnus, makers of TotalView, The debugger for complex code. Debugging C/C++ programs can leave you feeling lost and disoriented. TotalView can help you find your way. Available on major UNIX and Linux platforms. Try it free. www.etnus.com
_______________________________________________ Courier-maildrop mailing list Cour...@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/courier-maildrop







