0
0
Fork 0
mirror of https://codeberg.org/forgejo/docs.git synced 2024-12-26 22:51:22 -05:00
forgejo-docs/v1.19/admin/email-setup.md
André Jaenisch fd2e4f538c Fix email user
Naming is hard 8)

Signed-off-by: André Jaenisch <andre.jaenisch@posteo.de>
2023-03-03 22:01:51 +01:00

2.4 KiB

layout title license origin_url
~/layouts/Markdown.astro Email setup Apache-2.0 699f20234b/docs/content/doc/usage/email-setup.en-us.md

Forgejo 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.

Using Sendmail

Use sendmail command as mailer.

Note: For use in the official Forgejo container image, please configure with the SMTP version (see the following section).

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.

[mailer]
ENABLED       = true
FROM          = forgejo@example.com
MAILER_TYPE   = sendmail
SENDMAIL_PATH = /usr/sbin/sendmail
SENDMAIL_ARGS = "--" ; most "sendmail" programs take options, "--" will prevent an email address being interpreted as an option.

Using SMTP

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.

[mailer]
ENABLED        = true
FROM           = forgejo@example.com
MAILER_TYPE    = smtp
SMTP_ADDR      = mail.example.com
SMTP_PORT      = 587
IS_TLS_ENABLED = true
USER           = forgejo@example.com
PASSWD         = `password`

Restart Forgejo for the configuration changes to take effect.

To send a test email to validate the settings, go to Forgejo > Site Administration > Configuration > SMTP Mailer Configuration.

For the full list of options check the Config Cheat Sheet.

Please note: authentication is only supported when the SMTP server communication is encrypted with TLS or HOST=localhost. TLS encryption can be through:

  • 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.
  • SMTPS connection (SMTP over TLS) via the default port 465. Connection to the server use TLS from the beginning.
  • Forced SMTPS connection with IS_TLS_ENABLED=true. (These are both known as Implicit TLS.) This is due to protections imposed by the Go internal libraries against STRIPTLS attacks.

Note that Implicit TLS is recommended by RFC8314 since 2018.