Hello,
I've spent my all day trying to achieve this, with no success.
Here is the deal:
We use PMG as outgoing mail gateway. Permitted networks can relay mail to PMG, PMG filters these mails and then relays the mail to a smarthost.
There are thousands of sender domains, which is why we use permitted networks, because adding domains to PMG is not practical nor possible.
we use relayhost= option in postfix main.cf to relay emails to the smarthost.
Now the problem is that when we add "notify" to any spam action, also notification emails are being relayed to smarthost. Which is not what we want. All emails generated my PMG should be sent from localhost instead.
We tried "sender_dependent_relayhost_maps" option in order to achieve this but this option doesn't have wildcard option therefore useless. Because;
If we don't use relayhost= and use sender_dependent_relayhost_maps, we specify different smarthosts for different domains. Which works fine. But sender_dependent_relayhost_maps doesn't accept wildcard. So if domain is not in sender_dependent_relayhost_maps file, it is being sent locally.
if relayhost=xxxxx specified, we can override relayhost for certain domains using sender_dependent_relayhost_maps, but there is no option for "do not relay for this domain". It only accepts smarthosts. I can specify different smarthosts but I cannot make it "not relay".
Any help will be appriciated regarding this issue.
Thanks in advance.
I've spent my all day trying to achieve this, with no success.
Here is the deal:
We use PMG as outgoing mail gateway. Permitted networks can relay mail to PMG, PMG filters these mails and then relays the mail to a smarthost.
There are thousands of sender domains, which is why we use permitted networks, because adding domains to PMG is not practical nor possible.
we use relayhost= option in postfix main.cf to relay emails to the smarthost.
Now the problem is that when we add "notify" to any spam action, also notification emails are being relayed to smarthost. Which is not what we want. All emails generated my PMG should be sent from localhost instead.
We tried "sender_dependent_relayhost_maps" option in order to achieve this but this option doesn't have wildcard option therefore useless. Because;
If we don't use relayhost= and use sender_dependent_relayhost_maps, we specify different smarthosts for different domains. Which works fine. But sender_dependent_relayhost_maps doesn't accept wildcard. So if domain is not in sender_dependent_relayhost_maps file, it is being sent locally.
if relayhost=xxxxx specified, we can override relayhost for certain domains using sender_dependent_relayhost_maps, but there is no option for "do not relay for this domain". It only accepts smarthosts. I can specify different smarthosts but I cannot make it "not relay".
Any help will be appriciated regarding this issue.
Thanks in advance.