You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add warning to mailer documentation about authentication (#11563)
* Add warning to mailer documentation about authentication
References #7966
Signed-off-by: Andrew Thornton <art27@cantab.net>
* As per @guillep2k and @mrsdizzie
* as per @mrsdizzie
Signed-off-by: Andrew Thornton <art27@cantab.net>
Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
Copy file name to clipboardExpand all lines: custom/conf/app.ini.sample
+5-2Lines changed: 5 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -627,7 +627,8 @@ SUBJECT_PREFIX =
627
627
; Mail server
628
628
; Gmail: smtp.gmail.com:587
629
629
; QQ: smtp.qq.com:465
630
-
; Note, if the port ends with "465", SMTPS will be used. Using STARTTLS on port 587 is recommended per RFC 6409. If the server supports STARTTLS it will always be used.
630
+
; Using STARTTLS on port 587 is recommended per RFC 6409.
631
+
; Note, if the port ends with "465", SMTPS will be used.
631
632
HOST =
632
633
; Disable HELO operation when hostnames are different.
633
634
DISABLE_HELO =
@@ -639,11 +640,13 @@ SKIP_VERIFY =
639
640
USE_CERTIFICATE = false
640
641
CERT_FILE = custom/mailer/cert.pem
641
642
KEY_FILE = custom/mailer/key.pem
642
-
; Should SMTP connection use TLS
643
+
; Should SMTP connect with TLS, (if port ends with 465 TLS will always be used.)
644
+
; If this is false but STARTTLS is supported the connection will be upgraded to TLS opportunistically.
643
645
IS_TLS_ENABLED = false
644
646
; Mail from address, RFC 5322. This can be just an email address, or the `"Name" <email@example.com>` format
645
647
FROM =
646
648
; Mailer user name and password
649
+
; Please Note: Authentication is only supported when the SMTP server communication is encrypted with TLS (this can be via STARTTLS) or `HOST=localhost`.
647
650
USER =
648
651
; Use PASSWD = `your password` for quoting if you use special characters in the password.
-`HELO_HOSTNAME`: **\<empty\>**: Custom hostname for HELO operation.
399
399
-`HOST`: **\<empty\>**: SMTP mail host address and port (example: smtp.gitea.io:587).
400
+
- Using opportunistic TLS via STARTTLS on port 587 is recommended per RFC 6409.
401
+
-`IS_TLS_ENABLED` : **false** : Forcibly use TLS to connect even if not on a default SMTPS port.
402
+
- Note, if the port ends with `465` SMTPS/SMTP over TLS will be used despite this setting.
403
+
- Otherwise if `IS_TLS_ENABLED=false` and the server supports `STARTTLS` this will be used. Thus if `STARTTLS` is preferred you should set `IS_TLS_ENABLED=false`.
400
404
-`FROM`: **\<empty\>**: Mail from address, RFC 5322. This can be just an email address, or
401
405
the "Name" \<email@example.com\> format.
402
406
-`USER`: **\<empty\>**: Username of mailing user (usually the sender's e-mail address).
403
407
-`PASSWD`: **\<empty\>**: Password of mailing user. Use \`your password\` for quoting if you use special characters in the password.
408
+
- Please note: authentication is only supported when the SMTP server communication is encrypted with TLS (this can be via `STARTTLS`) or `HOST=localhost`. See [Email Setup]({{< relref "doc/usage/email-setup.en-us.md" >}}) for more information.
404
409
-`SKIP_VERIFY`: **\<empty\>**: Do not verify the self-signed certificates.
405
410
-**Note:** Gitea only supports SMTP with STARTTLS.
406
411
-`SUBJECT_PREFIX`: **\<empty\>**: Prefix to be placed before e-mail subject lines.
@@ -415,7 +420,6 @@ set name for unique queues. Individual queues will default to
415
420
-`SENDMAIL_PATH`: **sendmail**: The location of sendmail on the operating system (can be
416
421
command or full path).
417
422
-`SENDMAIL_TIMEOUT`: **5m**: default timeout for sending email through sendmail
418
-
-``IS_TLS_ENABLED`` : **false** : Decide if SMTP connections should use TLS.
Copy file name to clipboardExpand all lines: docs/content/doc/usage/email-setup.en-us.md
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -46,6 +46,12 @@ PASSWD = `password`
46
46
47
47
For the full list of options check the [Config Cheat Sheet]({{< relref "doc/advanced/config-cheat-sheet.en-us.md" >}})
48
48
49
+
- Please note: authentication is only supported when the SMTP server communication is encrypted with TLS or `HOST=localhost`. TLS encryption can be through:
50
+
- Via the server supporting TLS through STARTTLS - usually provided on port 587. (Also known as Opportunistic TLS.)
51
+
- SMTPS connection (SMTP over transport layer security) via the default port 465.
52
+
- Forced SMTPS connection with `IS_TLS_ENABLED=true`. (These are both known as Implicit TLS.)
53
+
- This is due to protections imposed by the Go internal libraries against STRIPTLS attacks.
54
+
49
55
### Gmail
50
56
51
57
The following configuration should work with GMail's SMTP server:
0 commit comments