Merge pull request #1063 from mattermost/SMTP-update

Updated to use System Console
Этот коммит содержится в:
Corey Hulen
2015-10-15 09:02:56 -07:00
родитель 3499401aca 9d93f61a2b
Коммит 3e8dcffc0a

Просмотреть файл

@@ -1,55 +1,46 @@
## SMTP Email Setup ## SMTP Email Setup
In some product evaluation setups, email is intentionally bypassed by setting `SendEmailNotifications=false`. 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. In product evaluation setups with single-container Docker instances, email is intentionally disabled. This allows account creation and system operation without having to set up email, but it also means email notification and password reset functionality aren't available.
To enable email, turn this option on by setting `SendEmailNotifications=true` and configuring an SMTP email service as follows: ### How to enable email
1. **Set up an SMTP email sending service.** (If you already have credentials for a SMTP server you can skip this step.) To enable email, configure an SMTP email service as follows:
1. [Setup Amazon Simple Email Service](https://console.aws.amazon.com/ses)
2. From the `SMTP Settings` menu click `Create My SMTP Credentials` 1. **Set up an SMTP email sending service** (if you don't yet have an SMTP service with credentials)
3. Copy the `Server Name`, `Port`, `SMTP Username`, and `SMTP Password` 1. Any SMTP email service can be used, you just need the following information: `Server Name`, `Port`, `SMTP Username`, and `SMTP Password`.
4. From the `Domains` menu setup and verify a new domain. It it also a good practice to enable `Generate DKIM Settings` for this domain. 2. If you don't have an SMTP service, here are simple instructions to set one up with [Amazon Simple Email Service (SES)](https://aws.amazon.com/ses/):
5. Choose an email address like `mattermost@example.com` for Mattermost to send emails from. 2. Go to [Amazon SES console](https://console.aws.amazon.com/ses) then `SMTP Settings > Create My SMTP Credentials`
6. Test sending an email from `mattermost@example.com` by clicking the `Send a Test Email` button and verify everything appears to be working correctly. 3. Copy the `Server Name`, `Port`, `SMTP Username`, and `SMTP Password` for Step 2 below.
2. **Modify the Mattermost configuration file config.json or config_docker.json with the SMTP information.** 4. From the `Domains` menu set up and verify a new domain, then enable `Generate DKIM Settings` for the domain.
1. If you're running Mattermost on Amazon Beanstalk you can shell into the instance with the following commands 5. Choose an sender address like `mattermost@example.com` and click `Send a Test Email` to verify setup is working correctly.
2. `ssh ec2-user@[domain for the docker instance]` 2. **Configure SMTP settings**
3. `sudo gpasswd -a ec2-user docker` 1. Open the **System Console** by logging into an existing team and accessing "System Console" from the main menu.
4. Retrieve the name of the container with `sudo docker ps` 1. Alternatively, if a team doesn't yet exist, go to `http://dockerhost:8065/` in your browser, create a team, then from the main menu click **System Console**
5. `sudo docker exec -ti container_name /bin/bash` 2. Go to the **Email Settings** tab and configure the following:
3. **Edit the config file `vi /config_docker.json` with the settings you captured from the step above.** 1. **Allow Sign Up With Email:** `true`
1. See an example below and notice `SendEmailNotifications` has been set to `true` 2. **Send Email Notifications:** `true`
``` 3. **Require Email Verification:** `true`
"EmailSettings": { 4. **Notification Display Name:** Display name on email account sending notifications
"EnableSignUpWithEmail": true, 5. **Notification Email Address:** Email address displayed on email account used to send notifications
"SendEmailNotifications": true, 6. **SMTP Username**: `SMTP Username` from Step 1
"RequireEmailVerification": true, 7. **SMTP Password**: `SMTP Password` from Step 1
"FeedbackName": "No-Reply", 8. **SMTP Server**: `SMTP Server` from Step 1
"FeedbackEmail": "mattermost@example.com", 9. **SMTP Port**: `SMTP Port` from Step 1
"SMTPUsername": "AFIADTOVDKDLGERR", 10. **Connection Security**: `TLS (Recommended)`
"SMTPPassword": "DFKJoiweklsjdflkjOIGHLSDFJewiskdjf", 11. Then click **Save**
"SMTPServer": "email-smtp.us-east-1.amazonaws.com",
"SMTPPort": "465", 3. **Restart Mattermost**
"ConnectionSecurity": "TLS", 1. Use `ps -A` to find the process ID ("pid") for service named `platform` and stop it using `kill [pid]`
"InviteSalt": "bjlSR4QqkXFBr7TP4oDzlfZmcNuH9YoS", 2. The service should restart automatically. Run `ps -A` to verify the `platform` is running again
"PasswordResetSalt": "vZ4DcKyVVRlKHHJpexcuXzojkE5PZ5eL", 3. Use the reset password page (E.g. _example.com/teamname/reset_password_) to test that email is now working by entering your email and clicking **Reset my password**.
"ApplePushServer": "", 4. Note: The next time users log out, or when their session tokens expire, each will be required to verify their email address.
"ApplePushCertPublic": "",
"ApplePushCertPrivate": ""
},
```
4. **Restart Mattermost**
1. Find the process id with `ps -A` and look for the process named `platform`
2. Kill the process `kill pid`
3. The service should restart automatically. Verify the Mattermost service is running with `ps -A`
4. Current logged in users will not be affected, but upon logging out or session expiration users will be required to verify their email address.
### Troubleshooting SMTP ### Troubleshooting SMTP
If you have issues with your SMTP install, from your Mattermost team site go to the main menu and open `System Console > Logs` to look for error messages related to your setup. You can do a search for the error code to narrow down the issue. Sometimes ISPs require nuanced setups for SMTP and error codes can hint at how to make the proper adjustments. If you have issues with your SMTP install, from your Mattermost team site go to the main menu and open **System Console -> Logs** to look for error messages related to your setup. You can do a search for the error code 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 `System Console > Logs` has an error code reading: For example, if **System Console -> Logs** has an error code reading:
``` ```
Connection unsuccessful: Failed to add to email address - 554 5.7.1 <unknown[IP-ADDRESS]>: Client host rejected: Access denied Connection unsuccessful: Failed to add to email address - 554 5.7.1 <unknown[IP-ADDRESS]>: Client host rejected: Access denied