[kwlug-disc] /etc/valiases, piping and "local delivery failed"??

Chris Irwin chris at chrisirwin.ca
Fri Apr 16 16:14:03 EDT 2010


On Thu, Apr 15, 2010 at 15:24, Robert P. J. Day <rpjday at crashcourse.ca> wrote:
>
>  a short followup to my postings from yesterday, in which i wanted to
> set up a /etc/valiases file to redirect the incoming message to a
> *multitude* of executables (PHP, shell script, whatever).
>
>  the original incantation:
>
> *: "| name-of-PHP-script.php"
>
> worked fine.  when i replaced it with my duplication script, it worked
> fine, but emailing to that domain also produced a "local delivery
> failed" error, even though the message was actually processed
> properly.
>
>  to strip the situation down to its bare essentials, i wrote a
> simpler shell script which simply did a pass through:
>
>  #!/bin/bash
>  tee >(php $1) > /dev/null
>
> and set the /etc/valiases file to:
>
>  *: "| name-of-shell-script.sh name-of-PHP-script.php"
>
> in other words, i just added another level of complexity for testing
> purposes.  i still got the "local delivery failed" error, so it's
> clearly something involving the way the shell invocation is being
> done.
>
>  what is it that causes that delivery error message to be generated?
> am i not passing back the appropriate error code from the script?  as
> i said, the setup actually works, but *something* is informing the
> mailer (incorrectly) that delivery did not take place, even when it
> has.

I'm not familiar with valiases (postfix user here), but have you
checked your return code? Ensuring you have an `exit 0` at the end
should always indicate "success".

Here is a list of return codes for qmail's valiases feature:
http://www.qmailwiki.org/index.php/Vpopmail#valias_2


-- 
Chris Irwin
<chris at chrisirwin.ca>



More information about the kwlug-disc_kwlug.org mailing list