- Plesk for Linux
Is it possible to configure Postfix on Plesk to use the Smarthost on a per-domain basis?
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.
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
# touch /etc/postfix/relay_map
/etc/postfix/relay_map, adding the following line:
example.comwith the domain which should use the smarthost,
smarthost.comwith the Smarthost address. 25 is the outgoing mail port (can be altered, as well).
CONFIG_TEXT: @example.com [smarthost.com]:25
Run the following command to create a hashed version of relay map:
# postmap /etc/postfix/relay_map
/etc/postfix/main.cf, adding the following line:
CONFIG_TEXT: 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.