[email protected]:
> > Yes. But, are you sure the problem is the mail header and not the
> > MAIL FROM command?
>
> No, I'm not sure. However, considering some servers will also reject
> mail where the From: header domain is inconsistent with envelope
> hostnames, I suppose it doesn't matter. Either way, I need postfix to
> somehow get the external IP address, and use it (certainly on the EHLO
> and MAIL FROM domain, and perhaps sometimes do a substitute the From:
> domain)
To rewrite both envelope AND header requires canonical_maps.
/etc/postfix/main.cf:
canonical_maps = hash:/etc/postfix/canonical
/etc/postfix/canonical
@bad.example.com @good.example.com
This rewriting happens *BEFORE* mail is stored in the to the queue.
This part of Postfix knows nothing about IP addresses.
Rewriting headers-only can be kludged with smtp_header_checks,
but that code also knows nothing about IP addresses.
Wietse