Skip to content
This repository was archived by the owner on Apr 17, 2023. It is now read-only.

Commit 1d7cd2f

Browse files
committed
Extended documentation for the mailer
See #1967 Signed-off-by: Miquel Sabaté Solà <[email protected]>
1 parent 2111cdd commit 1d7cd2f

File tree

1 file changed

+68
-6
lines changed

1 file changed

+68
-6
lines changed

_docs/Configuring-Portus.md

Lines changed: 68 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,80 @@ here](/docs/secrets.html).
6363
email:
6464
6565
name: "Portus"
66-
reply_to: "[email protected]"
66+
reply_to: ""
6767

6868
smtp:
6969
enabled: false
7070
address: "smtp.example.com"
71-
port: 587,
72-
user_name: "[email protected]"
73-
password: "password"
74-
domain: "example.com"
71+
port: 587,
72+
domain: "example.com"
73+
74+
##
75+
# SSL.
76+
77+
ssl_tls: ""
78+
enable_starttls_auto: false
79+
openssl_verify_mode: "none"
80+
ca_path: ""
81+
ca_file: ""
82+
83+
##
84+
# Authentication
85+
86+
user_name: ""
87+
password: ""
88+
authentication: "login"
7589
{% endhighlight %}
7690

77-
Note that if **smtp** is disabled, then `sendmail` is used instead (the specific command being: `/usr/sbin/sendmail -i -t`).
91+
There are some important things to note from **SMTP** support:
92+
93+
1. If SMTP is disabled, then `sendmail` is used instead (the specific command
94+
being: `/usr/sbin/sendmail -i -t`).
95+
2. Most options described here have a direct translation in
96+
[ActiveMailer::Base](https://api.rubyonrails.org/v5.1/classes/ActionMailer/Base.html),
97+
which is the mailer used by Portus. If you go over the "Configuration
98+
options" section, you will start to see the same keys as in the Portus
99+
configuration, and their documentation.
100+
3. The `ssl_tls` key is a combination of the `ssl` and the `tls` options as
101+
described in the [documentation of
102+
ActiveMailer::Base](https://api.rubyonrails.org/v5.1/classes/ActionMailer/Base.html). If
103+
you don't want SSL support, then simply leave this option empty. Otherwise,
104+
you will have to write either "ssl" or "tls" to enable any of these
105+
options. Moreover, `openssl_verify_mode` accepts only two values: "none" (the
106+
default), or "peer". Again, refer to the same documentation for more info.
107+
3. Authentication is only enabled if you provide a `user_name`. Moreover, note
108+
that the password that you have to write might be different than the one you
109+
have on your personal account (e.g. some providers like GMail ask you to
110+
create application passwords if you are using two-factor
111+
authentication). Last but not least, `authentication` can only have three
112+
values: "login", "plain" or "cram_md5". Check the [documentation of
113+
ActiveMailer::Base](https://api.rubyonrails.org/v5.1/classes/ActionMailer/Base.html)
114+
in order to see what's the right value for you.
115+
4. Note that this configuration section will be directly mapped into options
116+
that are passed into the mailer. We are using the same mailer as many other
117+
Ruby on Rails applications, so all the examples posted on different places
118+
should also apply here. For example, Gitlab has written an [awesome
119+
list](https://docs.gitlab.com/omnibus/settings/smtp.html) which describes
120+
which options are to be used for each mail provider.
121+
122+
An example configuration for GMail might look like:
123+
124+
{% highlight yaml %}
125+
email:
126+
127+
name: "Name"
128+
129+
smtp:
130+
enabled: true
131+
address: "smtp.gmail.com"
132+
port: 587,
133+
domain: "smtp.gmail.com"
134+
user_name: "[email protected]"
135+
password: "two-factor-password"
136+
authentication: "login"
137+
enable_starttls_auto: true
138+
openssl_verify_mode: "none"
139+
{% endhighlight %}
78140

79141
### Gravatar
80142

0 commit comments

Comments
 (0)