On Tue, Mar 4, 2008 at 10:05 AM, Alessandro Vesely <[EMAIL PROTECTED]> wrote:
> rupert wrote:
> > On Mon, Mar 3, 2008 at 8:04 PM, Alessandro Vesely <[EMAIL PROTECTED]>
> wrote:
> >> rupert wrote:
> >> > ISDIR=0
> >> > # Let's check if /home/vmail/domain.tld/username exists
> >> > `if [ -d "$VHOME/$USERDOMAIN/$ACCOUNT" ];then ISDIR="1"; fi`
> >>
> >> Setting a variable in a child process has no effect. Try
> >>
> >> `test -d "$VHOME/$USERDOMAIN/$ACCOUNT"`
> >> if (!$RETURNCODE)
> >> {
> >> ISDIR="1";
> >> }
> >
>
> > Yesterday I did some tests, and it looks like no matter if the if
> > condition is zero or one,
> > it always executes the commandos inside the condition:
> > Look at the line "/etc/maildroprc(20): Evaluating IF condition." on
> > each section:
> >
> >
>
> > /etc/maildroprc(12): ISDIR="0"
> > maildrop: Filtering through `if [ -d "$VHOME/$USERDOMAIN/$ACCOUNT"
> > ];then ISDIR="1"; fi`
>
> That filtering instruction launches a shell process. The shell
> presumably uses its internal version of /bin/test in order to
> determine if the directory exist. In case it exists, the shell
> subprocess will set an environment variable. The coincidental fact
> that a variable in the subprocess bears the same name as one used in
> the parent process is not relevant at all: after the subprocess
> terminates, the environment it used, recycled, wasted, destroyed,
> removed, forgotten.
>
> In order to get results from a subprocess one can
> * check its return code,
> * retrieve its output,
> * use IPC while both processes are still running.
>
> (Other OSes may have different arrangements than *nix)
>
>
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"
}
> > /etc/maildroprc(20): Evaluating IF condition.
> > /etc/maildroprc(20): Operation on: 0 and 1 - not equal, result is 1
> > /etc/maildroprc(20): IF evaluated, result=1
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> -------------------------------------------------------------------------
> 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
>
-------------------------------------------------------------------------
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