On 2011-03-03 at 10:00 +0100, Joachim Astel wrote:
> Setup a perl script at /etc/exim4/mailheaderadd.pl, which contains:
> sub mailheaderadd {
>         my $xsource = $ENV{'X-SOURCE'};

This may be problematic -- using a hyphen in an environment variable
renders it inaccessible to shell and might cause problems in other
scripting languages too.  So you would want $X_SOURCE for reliability.

In this case, without shell in the way, you should be okay; but you're
storing up problems for later.

> Then use the appropriate transport and insert the add_headers line:
> 
> procmail_pipe:
>   [...]
>   headers_add = "${perl{mailheaderadd}}"

Transports happen in deliveries from the queue, much later than the
process where the mail is received and processed.

What if you use an $acl_m_... variable instead?

On either the MAIL or the RCPT ACL, "set acl_m_new_headers = ${perl...}"
and then in procmail_pipe you can "headers_add = $acl_m_new_headers".

-Phil

-- 
## List details at http://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/

Reply via email to