Peter,

I think this is the way, but how could I check return value without
breaking pipe?

vdelivermail '' bounce-no-mailbox && [ $? == 0 ] && qmail-inject
[EMAIL PROTECTED]

Won't work because when I use && the pipe is broken
After all, it's really ugly

vdelivermail '' bounce-no-mailbox
[ $? == 0 ] && qmail-inject [EMAIL PROTECTED]

Would be more elegant, but I'm not sure if in the next pipe $? represents
return value of last pipe. And the pipe would be broken again.
If $? represent the last pipe exit code, I think it's possible to write 
stuff like 

#!/usr/bin/perl 
$exit = `echo $?`
if($exit != 100) {exit(99);}
open INJECT, "vert-bar qmail-inject";
while(<>){
        print INJECT;
}
exit(99)

As you probably already seen, my vertical bar is broken.
The problem is that I couldn't get the right value of $? inside the script.

Any further help?
Peter?

Thanks in advance 

[]s
Davi





Peter Green escritas:

> also sprach davi:
> > 
> > But this way EVERY message will also goes to postmaster.
> > I dunno what's the return value of vdelivermail in a bounce, but depending
> > it all messages will go to postmaster, except the ones that bounced
> > (according to qmail-command man page)
> 
> From the vdelivermail man page:
> 
>      _________________________________________________________________
>    
>     RETURN VALUE
> 
>    0 if all steps were successful. 100 if user is over quota or
>    bounce-no-mailbox is set and no matching user is found.
>      _________________________________________________________________
> 
> You can check the return code of vdelivermail for 100 and, if found, deliver
> to the postmaster mailbox.
> 
> /pg
> -- 
> Peter Green : Gospel Communications Network, SysAdmin : [EMAIL PROTECTED]
> ---
> > I've hacked the Xaw3d library to give you a Win95 like interface and it
> > is named Xaw95. You can replace your Xaw3d library.
> Oh God, this is so disgusting!
> (Seen on c.o.l.development.apps, about the "Win95 look-alike")
> 

Reply via email to