Discussion:
Relay host configuration and null envelope senders
(too old to reply)
d***@gmail.com
2016-09-26 23:01:29 UTC
Permalink
Hi,

We have, maybe, a bit of an unusual setup for office365 customers we deliver email to through our spam/AV scanners on specific ports. The relay works fine for senders when the envelope sender address is not null. We do a relay_domains select from a postgres database using @domain to match addresses from domains that we allow the relay to happen for, then using that we select a transport that is a server:port entry in the table.

Relevent postfix config lines:

relay_domains = pgsql:/etc/postfix/pgsql/relay_domains.cf
sender_dependent_default_transport_maps = pgsql:/etc/postfix/pgsql/relay_transport.cf

The default_transport is discard and the problem is that when we get an envelope sender address = <> we, of course, discard the message. We have a feature request to now check the header sender address and perform the same action using that instead of the envelope address and that is where I am failing.

If anyone has any pointers here or wants more config or log messages let me know and I would appreciate greatly any help on the issue.
d***@gmail.com
2016-09-29 22:09:35 UTC
Permalink
Post by d***@gmail.com
Hi,
relay_domains = pgsql:/etc/postfix/pgsql/relay_domains.cf
sender_dependent_default_transport_maps = pgsql:/etc/postfix/pgsql/relay_transport.cf
The default_transport is discard and the problem is that when we get an envelope sender address = <> we, of course, discard the message. We have a feature request to now check the header sender address and perform the same action using that instead of the envelope address and that is where I am failing.
If anyone has any pointers here or wants more config or log messages let me know and I would appreciate greatly any help on the issue.
In order to fix this issue I changed the line(in main.cf):

sender_dependent_default_transport_maps = pgsql:/etc/postfix/pgsql/relay_transport.cf

to

header_checks = pgsql:/etc/postfix/pgsql/relay_transport.cf

and used this query in relay_transport.cf to select the relay host entry:

query = SELECT 'FILTER ' || host FROM portoffice365s WHERE domainname like '%%@%d'
Loading...