We've been using PMG for a couple of weeks but today I saw our IP address seems to be on a Microsoft blocklist - ignore this part, how to get unblocked is not the reason why I am posting.
Rather, I'd like to see how to get PMG to work with selective smarthosts or possibly some other suggestions for the future.
Before we had PMG between the mail server and the internet we had a useful option for sending mails, which came in handy a couple of times during the years:
Send all emails directly fist, and then to smart hosts if there are problems.
For Postfix, it does seem there are ways to set up selective smart hosts based on the recipients by adding
https://serverfault.com/questions/663418/relay-host-based-on-destination-mx-record/663435#663435
I tried a few different ways, but eventually gave up since non of them really worked - possibly due to my requirement of smtp auth for my smarthost which seems to work if I use
Another solution mentioned relay host depending to receiver address (untested):
https://tipstricks.itmatrix.eu/relaying-emails-dependent-on-either-sender-or-receiver/
What that work with PMG? Enabling SMTP authentication would also work?
Currently I am sending ALL mail via smarthost that requires auth via template in /etc/pmg/templates/main.cf.in, but I'd like to get a better solution in the future...
Current working config:
Any ideas?
Rather, I'd like to see how to get PMG to work with selective smarthosts or possibly some other suggestions for the future.
Before we had PMG between the mail server and the internet we had a useful option for sending mails, which came in handy a couple of times during the years:
Send all emails directly fist, and then to smart hosts if there are problems.
For Postfix, it does seem there are ways to set up selective smart hosts based on the recipients by adding
check_recipient_mx_access
in smtpd_*_restriction
:https://serverfault.com/questions/663418/relay-host-based-on-destination-mx-record/663435#663435
I tried a few different ways, but eventually gave up since non of them really worked - possibly due to my requirement of smtp auth for my smarthost which seems to work if I use
relayhost
on its own (see below) but not if in combination with the above solutions.Another solution mentioned relay host depending to receiver address (untested):
https://tipstricks.itmatrix.eu/relaying-emails-dependent-on-either-sender-or-receiver/
Code:
Add in /etc/postfix/transport:
@example4.com relay:[relay.server.com]:25
someone@example5.com relay:[relay.server.com]:25
someoneelse@example6.com local
* smtp
What that work with PMG? Enabling SMTP authentication would also work?
Currently I am sending ALL mail via smarthost that requires auth via template in /etc/pmg/templates/main.cf.in, but I'd like to get a better solution in the future...
Current working config:
Code:
relayhost = [smtp.example.com]:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
Any ideas?
Last edited: