Smarthost enhancement

Try this:

Create /etc/e-smith/templates-custom/etc/postfix/main.cf/29Authentication

mkdir -p /etc/e-smith/templates-custom/etc/postfix/main.cf
cd /etc/e-smith/templates-custom/etc/postfix/main.cf
vi 29Authentication

#
# custom
#
# 29Authentication
#

{
    if($postfix{SmartHostStatus} ne 'enabled') {
    return <<FRAGMENT
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_mechanism_filter = plain, login
smtp_sasl_security_options =
smtp_tls_policy_maps = hash:/etc/postfix/tls_policy
FRAGMENT
    }
}

#smtp_sasl_auth_enable = yes
#smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
#smtp_sasl_mechanism_filter = plain, login
#smtp_sasl_security_options =
#smtp_tls_policy_maps = hash:/etc/postfix/tls_policy
smtp_sender_dependent_authentication = yes
sender_dependent_relayhost_maps = hash:/etc/postfix/relayhost_maps

:

Create /etc/e-smith/templates-custom/etc/postfix/relayhost_maps/20Relayhosts_map

mkdir -p /etc/e-smith/templates-custom/etc/postfix/relayhost_maps
cd /etc/e-smith/templates-custom/etc/postfix/relayhost_maps
vi 29Relayhosts_map

#
# custom
#
# 20Relayhost_maps
#

yourdomain.tld	[smarthost.yourdomain.tld]:25

Create /etc/e-smith/templates-custom/etc/postfix/sasl_passwd/30Authentication

mkdir -p /etc/e-smith/templates-custom/etc/postfix/sasl_passwd
cd /etc/e-smith/templates-custom/etc/postfix/sasl_passwd
vi 30Authentication

#
# custom
#
# 30Authentication

user1@yourdomain.tld		login_user1:password_user1
user2@yourdomain.tld		login_user2:password_user2
user3@yourdomain.tld		login_user3:password_user3

finally give these commands to activate the changes

expand-template /etc/postfix/relayhost_maps
postmap /etc/postfix/relayhost_maps

expand-template /etc/postfix/sasl_passwd
postmap /etc/postfix/sasl_passwd

signal-event nethserver-mail-server-update

the same commands marked above should be given after making changes to the above configuration files

5 Likes