Skip to content

Commit bc5da3f

Browse files
bagasmezhaoxin
authored and
zhaoxin
committed
docs: rewrite email setup (go-gitea#16404)
* Add intro for both the docs page and mailer methods * Fix numbering level in SMTP section * Recommends implicit TLS Signed-off-by: Bagas Sanjaya <bagasdotme@gmail.com>
1 parent 2e048f5 commit bc5da3f

File tree

1 file changed

+19
-11
lines changed

1 file changed

+19
-11
lines changed

docs/content/doc/usage/email-setup.en-us.md

+19-11
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,15 @@ menu:
1919

2020
{{< toc >}}
2121

22-
To use Gitea's built-in Email support, update the `app.ini` config file [mailer] section:
22+
Gitea has mailer functionality for sending transactional emails (such as registration confirmation). It can be configured to either use Sendmail (or compatible MTAs like Postfix and msmtp) or directly use SMTP server.
2323

24-
## Sendmail version
24+
## Using Sendmail
2525

26-
Use the operating system’s sendmail command instead of SMTP. This is common on Linux servers.
27-
Note: For use in the official Gitea Docker image, please configure with the SMTP version.
26+
Use `sendmail` command as mailer.
27+
28+
Note: For use in the official Gitea Docker image, please configure with the SMTP version (see the following section).
29+
30+
Note: For Internet-facing sites consult documentation of your MTA for instructions to send emails over TLS. Also set up SPF, DMARC, and DKIM DNS records to make emails sent be accepted as legitimate by various email providers.
2831

2932
```ini
3033
[mailer]
@@ -34,7 +37,9 @@ MAILER_TYPE = sendmail
3437
SENDMAIL_PATH = /usr/sbin/sendmail
3538
```
3639

37-
## SMTP version
40+
## Using SMTP
41+
42+
Directly use SMTP server as relay. This option is useful if you don't want to set up MTA on your instance but you have an account at email provider.
3843

3944
```ini
4045
[mailer]
@@ -47,17 +52,19 @@ USER = gitea@mydomain.com
4752
PASSWD = `password`
4853
```
4954

50-
- Restart Gitea for the configuration changes to take effect.
55+
Restart Gitea for the configuration changes to take effect.
5156

52-
- To send a test email to validate the settings, go to Gitea > Site Administration > Configuration > SMTP Mailer Configuration.
57+
To send a test email to validate the settings, go to Gitea > Site Administration > Configuration > SMTP Mailer Configuration.
5358

5459
For the full list of options check the [Config Cheat Sheet]({{< relref "doc/advanced/config-cheat-sheet.en-us.md" >}})
5560

56-
- Please note: authentication is only supported when the SMTP server communication is encrypted with TLS or `HOST=localhost`. TLS encryption can be through:
57-
- Via the server supporting TLS through STARTTLS - usually provided on port 587. (Also known as Opportunistic TLS.)
58-
- SMTPS connection (SMTP over transport layer security) via the default port 465.
61+
Please note: authentication is only supported when the SMTP server communication is encrypted with TLS or `HOST=localhost`. TLS encryption can be through:
62+
- STARTTLS (also known as Opportunistic TLS) via port 587. Initial connection is done over cleartext, but then be upgraded over TLS if the server supports it.
63+
- SMTPS connection (SMTP over TLS) via the default port 465. Connection to the server use TLS from the beginning.
5964
- Forced SMTPS connection with `IS_TLS_ENABLED=true`. (These are both known as Implicit TLS.)
60-
- This is due to protections imposed by the Go internal libraries against STRIPTLS attacks.
65+
This is due to protections imposed by the Go internal libraries against STRIPTLS attacks.
66+
67+
Note that Implicit TLS is recommended by [RFC8314](https://tools.ietf.org/html/rfc8314#section-3) since 2018.
6168

6269
### Gmail
6370

@@ -74,3 +81,4 @@ MAILER_TYPE = smtp
7481
IS_TLS_ENABLED = true
7582
HELO_HOSTNAME = example.com
7683
```
84+

0 commit comments

Comments
 (0)