Re: [exim] Alias-Error to /dev/null

Top Page
Delete this message
Reply to this message
Author: Mail(at)charliesangels.biz
Date:  
To: exim-users
Subject: Re: [exim] Alias-Error to /dev/null
Hi Magnus,

we use OTRS (http://otrs.org) for Trouble-Tickets. Now what we do is:

1) Put an alias in the aliases file
ops: "|/opt/otrs/bin/PostMaster.pl"

2) An e-mail send to ops@??? is then piped to this script,
inserted in the MySQL-Backend and a return message is generated:

[...]
Hello,

your email with the subject:

             Some Subject


is stored and will be processed within a short time.

Your email aquired the ticket-ID:

             4100093


For further queries regarding your mail always mention the ticket-ID in
the subject.
[...]

Now, if someone sends a not correctly UTF-8 encoded mail is is processed
correctly and also inserted into the DB but in addition a Mail delivery
error is generated:

[...]
This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

  pipe to |/opt/otrs/bin/PostMaster.pl
    generated by ops@myhost


The following text was generated during the delivery attempt:

------ pipe to |/opt/otrs/bin/PostMaster.pl
       generated by ops@myhost ------


Malformed UTF-8 character (unexpected non-continuation byte 0x73,
immediately after start byte 0xfc) in substitution (s///) at
/opt/otrs/Kernel/System/Ticket/Article.pm line 101.
Malformed UTF-8 character (unexpected non-continuation byte 0x73,
immediately after start byte 0xfc) in substitution (s///) at
/opt/otrs/Kernel/System/Ticket/Article.pm line 101.
Malformed UTF-8 character (unexpected non-continuation byte 0x73,
immediately after start byte 0xfc) in substitution (s///) at
/opt/otrs/Kernel/System/Ticket/Article.pm line 101.
Malformed UTF-8 character (unexpected non-continuation byte 0x6d,
immediately after start byte 0xe4) in substitution (s///) at
/opt/otrs/Kernel/System/Ticket/Article.pm line 101.
[...]

As the mail is correctly delivered - regardless of the Mail delivery error -
this Mail delivery error should not be send but instead piped to /dev/null
as it only confuses (Was the mail received or not ?)

I hope I managed to describe my problem more clearly ;)

Regards
Sascha

On Tuesday 12 December 2006 16:35, Mail(at)charliesangels.biz wrote:
> our /etc/aliases contains an Alias that is piped to a script:
>
> bla: "|/path/to/script.pl"
>
> Sometimes this script produces an error. sometimes....
> Unfortunately a fix (which would be the best solution) is not the easiest.
> Is there any way to pipe a possible error message to /dev/null ?
>
> I tried
>
> bla: "|/path/to/script.pl 2> /dev/null"
>
> but now all output is send to /dev/null, but only possible errors should
> land there.


I suppose you have use_shell set on your pipe transport, otherwise it won't
work at all. Now, only output sent to stderr should be redirected
to /dev/null. But of course, the system can't know if that output contains
anything that isn't an error message.

That said, I think you might want to have a look at the return_output and
return_fail_output options of the pipe transport. Whatever the script
outputs, Exim takes care of it and what Exim does depends on these options,
as well as the exit status of the script, of course. By default, both are
false, meaning that the output isn't used, so it isn't completely clear what
you really want to accomplish.

-- 
Magnus Holmgren        holmgren@xxxxxxxxxxxxxx
                       (No Cc of list mail needed, thanks)


"Exim is better at being younger, whereas sendmail is better for
Scrabble (50 point bonus for clearing your rack)" -- Dave Evans