Issue
When a user account is locked out, an unlock email is sent to the user's email address. By default, the email is sent regardless of gateways that are configured within notifications. Postfix is used to send the email directly to a recipient via Port 25. However, you may want to restrict your Control Panel server to resolve any SMTP relay on Port 25 if you have an isolated internal cloud. To change the default email settings, you can configure an SMTP relay to a specific address.
Environment
Please note, this is obsolete in OnApp 6.0. Just configure a gateway under notifications, and unlock emails will be sent via this.
OnApp 5.5
Resolution
Follow the next procedure to reconfigure the default Postfix settings:
- Install the package required for authentication:
# yum install cyrus-sasl{,-plain}
- Edit the Postfix config:
# nano /etc/postfix/main.cf
- Change the following values:
myhostname = fqdn.example.com
Add the following to the end of the file:
relay host = [smtp.gmail.com]:587
# Enable SASL authentication
smtp_sasl_auth_enable = yes
# Disallow methods that allow anonymous authentication
smtp_sasl_security_options = noanonymous
# Location of sasl_passwd
smtp_sasl_password_maps = hash:/etc/postfix/sasl/sasl_passwd
# Enable STARTTLS encryption
smtp_tls_security_level = encrypt3. Configure the password for your SMTP relay (if required):
Create the file if it does not exist as follows:# nano /etc/postfix/sasl/sasl_passwd
Add details of your SMTP relay:
[smtp.gmail.com]:587 gmailexample@gmail.com:password
4. Generate the sasl_passwd DB file:
# postmap /etc/postfix/sasl/sasl_passwd
5. Restart the Postfix service:
# service postfix restart
You should now received the unlock emails via the configured gateway.