3.1 KiB
SMTP Email Setup
In some product evaluation setups email is intentionally bypassed using a ByPassEmail=true option. This option allows account creation and system operation without having to set up an email service (e.g. no email verification is required for account creation). This also means neither email notifications nor password reset by email are available.
To enable email, turn this option off by setting ByPassEmail=false and configuring an SMTP email service as follows:
- Set up an SMTP email sending service. (If you already have credentials for a SMTP server you can skip this step.)
- Setup Amazon Simple Email Service
- From the
SMTP Settingsmenu clickCreate My SMTP Credentials - Copy the
Server Name,Port,SMTP Username, andSMTP Password - From the
Domainsmenu setup and verify a new domain. It it also a good practice to enableGenerate DKIM Settingsfor this domain. - Choose an email address like
feedback@example.comfor Mattermost to send emails from. - Test sending an email from
feedback@example.comby clicking theSend a Test Emailbutton and verify everything appears to be working correctly.
- Modify the Mattermost configuration file config.json or config_docker.json with the SMTP information.
- If you're running Mattermost on Amazon Beanstalk you can shell into the instance with the following commands
ssh ec2-user@[domain for the docker instance]sudo gpasswd -a ec2-user docker- Retrieve the name of the container with
sudo docker ps sudo docker exec -ti container_name /bin/bash
- Edit the config file
vi /config_docker.jsonwith the settings you captured from the step above.- See an example below and notice
ByPassEmailhas been set tofalse
"EmailSettings": { "ByPassEmail" : false, "SMTPUsername": "AKIADTOVBGERKLCBV", "SMTPPassword": "jcuS8PuvcpGhpgHhlcpT1Mx42pnqMxQY", "SMTPServer": "email-smtp.us-east-1.amazonaws.com:465", "UseTLS": true, "FeedbackEmail": "feedback@example.com", "FeedbackName": "Feedback", "ApplePushServer": "", "ApplePushCertPublic": "", "ApplePushCertPrivate": "" } - See an example below and notice
- Restart Mattermost
- Find the process id with
ps -Aand look for the process namedplatform - Kill the process
kill pid - The service should restart automatically. Verify the Mattermost service is running with
ps -A - Current logged in users will not be affected, but upon logging out or session expiration users will be required to verify their email address.
- Find the process id with
Troubleshooting SMTP
If you receive an error message during SMTP setup, do a web search for the error code number to narrow down the issue. Sometimes ISPs require nuanced setups for SMTP and error codes can hint at how to make the proper adjustments.
For example, if you have an error code reading:
Connection unsuccessful: Failed to add to email address - 554 5.7.1 <unknown[IP-ADDRESS]>: Client host rejected: Access denied
Search for 554 5.7.1 error and Client host rejected: Access denied.