Applicable to:
- Plesk for Linux
Question
Is it possible to configure Postfix on Plesk to use the Smarthost on a per-domain basis?
Answer
Such functionality is not implemented yet, you can vote for it on Plesk UserVoice:
The top-ranked suggestions are likely to be included in the next versions of Plesk.
Moved to internal, as it didn't work for a customer. Cross-check before applying!
Note: it is possible to configure Postfix to use Smarthost per domain basis via Postfix configuration. Such customizations were not tested properly and are not officially supported by Plesk, so perform it at your own risk.
-
Connect to the server via SSH.
-
Back up Postfix configuration file:
# cp /etc/postfix/main.cf /etc/postfix/main.cf.bk
-
Create the file
/etc/postfix/relay_map
# touch /etc/postfix/relay_map
-
Edit
/etc/postfix/relay_map
, adding the following line:Note: substitute
example.com
with the domain which should use the smarthost,smarthost.com
with the Smarthost address. 25 is the outgoing mail port (can be altered, as well).@example.com [smarthost.com]:25
-
Run the following command to create a hashed version of relay map:
# postmap /etc/postfix/relay_map
-
Edit
/etc/postfix/main.cf
, adding the following line:sender_dependent_relayhost_maps = hash:/etc/postfix/relay_map
-
Reload Postfix configuration:
# systemctl reload postfix
Refer to the Postfix official documentation for more information.
Note: Any customization made in Postfix configuration can be overwritten by Plesk Update (for example, in case of a bug fix, when configuration files are updates), Plesk Upgrade or by the mchk
utility, which resets default mail server configuration.
Comments
0 comments
Please sign in to leave a comment.