On Thu, Nov 06, 2008 at 04:20:25PM +0100, Iker Perez de Albeniz wrote:

> Hi,
> 
> I'am trying to add a new header to all input messages with a label like
> this:
> 
> X-Send-IP: senderip
> 
> i have tried something like this (in main.cf):
> smtp_data_restrictions = check_lcient_acces cidr:/etc/postfix/add_header
> 
> and add_header file is like :
> 0.0.0.0/0     PREPEND          X-Send-IP: ${client_addr}

There is mention of ${client_addr} in access(5) documentation, you
are making this up, and Postfix only implements what's documented.

PCRE and regexp tables can interpolate data from the input key into
the result:

    smtpd_data_restrictions =
        check_client_access pcre:/etc/postfix/add_header.pcre

    add_header.pcre:
        # Client name, not an IPv4/IPv6 address:
        /[^\d.:]/               DUNNO

        # Otherwise:
        /^(.*)$/        PREPEND X-Send-IP: ${1}

-- 
        Viktor.

Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the "Reply-To" header.

To unsubscribe from the postfix-users list, visit
http://www.postfix.org/lists.html or click the link below:
<mailto:[EMAIL PROTECTED]>

If my response solves your problem, the best way to thank me is to not
send an "it worked, thanks" follow-up. If you must respond, please put
"It worked, thanks" in the "Subject" so I can delete these quickly.

Reply via email to