Update dev_mailserver.md

Mail server configuration now is done on `config/secrets.yml` and thus
documentation should be updated accordingly.
This commit is contained in:
João Pimentel Ferreira
2020-11-13 13:15:39 +01:00
committed by Javi Martín
parent 9f107926a3
commit 45449f5556
2 changed files with 23 additions and 36 deletions

View File

@@ -23,7 +23,7 @@
* [Digital Ocean](en/installation/digital_ocean.md) * [Digital Ocean](en/installation/digital_ocean.md)
* [Heroku](en/installation/deploying-on-heroku.md) * [Heroku](en/installation/deploying-on-heroku.md)
* [Docker](en/installation/docker.md) * [Docker](en/installation/docker.md)
* [Development Mail Server](en/installation/dev_mailserver.md) * [Mail Server Configuration](en/installation/dev_mailserver.md)
* [Basic configuration](en/installation/basic_configuration.md) * [Basic configuration](en/installation/basic_configuration.md)
* [CONSUL Documentation and guides](en/installation/documentation_and_guides.md) * [CONSUL Documentation and guides](en/installation/documentation_and_guides.md)

View File

@@ -1,8 +1,8 @@
# Development Mail Server # Mail Server Configuration
This is a example to how integrate a mailing service with a development environment of Consul. This is an example of how to integrate a mailing service with Consul.
In this example we used [Mailgun](https://www.mailgun.com/). In this example we use [Mailgun](https://www.mailgun.com/).
## Create an account in Mailgun ## Create an account in Mailgun
@@ -11,41 +11,28 @@ In this example we used [Mailgun](https://www.mailgun.com/).
* Skip the credit card form * Skip the credit card form
* And activate your account with the link sent by email * And activate your account with the link sent by email
## Domain configuration ## Domain configuration
* Go to the Domains section:
![Mailgun domain section](../../img/mailserver/mailgun-domains.png)
* Since you don't have a domain yet, you should click in the sandbox that is already created; * Go to the Domains section: ![Mailgun domain section](../../img/mailserver/mailgun-domains.png)
* Remember the next credentials: * Since you don't have a domain yet, you should click in the sandbox that is already created
![Mailgun sandbox](../../img/mailserver/mailgun-sandbox.png) * Remember the following credentials: ![Mailgun sandbox](../../img/mailserver/mailgun-sandbox.png)
## Consul mailing configuration for development environment ## Consul mailing configuration
* Go to `config/environments/development.rb` file;
* Add the lines on the file to configure the mail server:
``` ruby * Go to the `config/secrets.yml` file
config.action_mailer.delivery_method = :smtp * Change the lines on the file to configure the mail server under the section `staging`, `preproduction` or `production`, depending on your setup:
config.action_mailer.perform_deliveries = true
config.action_mailer.smtp_settings = { ```yml
:address => '', mailer_delivery_method: :smtp
:port => 2525, smtp_settings:
:domain => '', :address: "<smtp address>"
:user_name => '', :port: 587
:password => '', :domain: "<domain>"
:authentication => :plain, :user_name: "<user_name>"
:enable_starttls_auto => true, :password: "<password>"
:ssl => false :authentication: "plain"
} :enable_starttls_auto: true
``` ```
* Fill, `address`, `domain`, `user_name`, `password` with your information. The file would look like:
![development.rb file](../../img/mailserver/development.rb.png) * Fill `<smtp address>`, `<domain>`, `<user_name>` and `<password>` with your information
* Save the file and restart your Consul application
## Consul mailing configuration for production environment
* Go to `config/environments/production.rb` file.
* Add the same **action mailer settings** configuration, but now with your production mail server information.
* Pay attention because you will need to change the **port** number to **587**.
You can also use Mailgun to production, adding your custom domain. Mailguns logs sent and delivered emails.