Re: [exim] add "X-Source" headers

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Phil Pennock
Ημερομηνία:  
Προς: Joachim Astel
Υ/ο: exim-users
Αντικείμενο: Re: [exim] add "X-Source" headers
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