• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Question Relay all outgoin mail of a specific domain to an external SMTP service

D. Molina

New Pleskian
Hi,

I have a server with plesk onyx and Centos. I use Postfix for email. In it I have 12 different domains (subscriptions)...
And I would like to use sendinblue for one of them. Let's say "domain1.com"

Sendinblue gave me this config:

smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = static:user:.pass
smtp_sasl_security_options = noanonymous
smtp_tls_security_level = may
header_size_limit = 4096000
relayhost = smtp-relay.sendinblue.com:587

I know how to do it for the whole server using main.cf, but how can I tell the server to relay all the outgoing email from domain1.com to this external server and leave the rest working with local smtp service?

It would be lovely if plesk creates a place to configure external smtp service for each subscription...


Thanks a lot for your help!!!!!
 
Hi D. Molina,

( untested !!! )

I could think of the solution, to use "sender_dependent_relayhost_maps" at your "/etc/postfix/main.cf" - configuration file, which is able to override the serverwide "relayhost" - settings for specific eMail - accounts.


Possible example:
Code:
smtp_sasl_password_maps = hash:/etc/postfix/sender_dependent_relayhost_sasl_pass
sender_dependent_relayhost_maps = hash:/etc/postfix/sender_dependent_relayhost
... where you ( manually ) create the file "/etc/postfix/sender_dependent_relayhost" with the example content:
Code:
#sender_dependent_relayhost_sasl_pass
[smtp-relay.sendinblue.com]:587   YOUR-PROVIDED-PASSWORD-CREDENTIALS:THIS-IS-THE-SENDINBLUE-PASSWORD
and
Code:
#sender_dependent_relayhost
[email protected]           [smtp-relay.sendinblue.com]:587
...while you setup "relayhost" inside the "main.cf" to
Code:
relayhost =

Code:
smtp_sasl_auth_enable = yes
smtp_sasl_security_options = noanonymous
smtp_tls_security_level = may
header_size_limit = 4096000
.. should stay as it is.


Pls. don't forget the commands:
Code:
/usr/sbin/postmap /etc/postfix/sender_dependent_relayhost_sasl_pass
and
Code:
/usr/sbin/postmap /etc/postfix/sender_dependent_relayhost
... to finalize your new configuration and restart postfix afterwards.​
 
Back
Top