Alvaro Marín wrote:
Hi,

i have tried something like this (in main.cf <http://main.cf>):
smtp_data_restrictions = check_lcient_acces cidr:/etc/postfix/add_header
and add_header file is like : 0.0.0.0/0 <http://0.0.0.0/0> PREPEND X-Send-IP: ${client_addr}

Perhaps you can do it with header_checks:

header_checks = pcre:/etc/postfix/header_checks

And the regexp something like...

/^Received: from .* \(.* \[([0-9\.]+)\]\).*$/     PREPEND X-Sender-IP: ${1}



no, this will add an X-Sender-IP for each received header found in the message. you could prevent this by making the expression more "precise", but Viktor suggestion is simpler and more robust.

Reply via email to