rupert wrote:
> On Tue, Mar 4, 2008 at 10:05 AM, Alessandro Vesely <[EMAIL PROTECTED]> wrote:
>> > /etc/maildroprc(12): ISDIR="0"
>>  > maildrop: Filtering through `if [ -d "$VHOME/$USERDOMAIN/$ACCOUNT"
>>  > ];then ISDIR="1"; fi`
>>
>>  In order to get results from a subprocess one can
>>  * check its return code,
>>  * retrieve its output,
>>  * [...]
>>
> but then should this work in the first place
> 
> `test -d "$VHOME/$USERDOMAIN/$ACCOUNT"`
> if(!$RETURNCODE)
> {
>    "only gets executed if the folder does "not" exist"
+    "only gets executed if the folder exists"
> }

`test` exits with status 0 if successful. Check RETURNCODE in 
http://www.courier-mta.org/maildropfilter.html#id326037

Notice that conditional constructs in the shell (i.e. if [...]; then) 
treat a 0 exit status as "true" because the exit status of 0 usually 
means success. That is the opposite of what most programming languages 
do (AFAIK all except Java, which doesn't automatically promote integer 
to boolean.)






















































-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
courier-users mailing list
[email protected]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to