For the mailer and incoming_mailer config, allow passwords to be read from a file.
Add `_URI` config values and use the existing `loadSecret` function to do this.
Resolves https://codeberg.org/forgejo/forgejo/issues/8113
Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8116
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: oliverpool <oliverpool@noreply.codeberg.org>
Co-authored-by: fruzitent <fruzit@gmail.com>
Co-committed-by: fruzitent <fruzit@gmail.com>
If `[email.incoming].USE_TLS` is set, but the port isn't, infer the
default from `.USE_TLS`: set the port to 993 if using tls, and to 143
otherwise. Explicitly setting a port overrides this.
Fixes #3357.
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>
The keys for setting the username and password for incoming and outgoing
mail are inconsisent: one uses `USERNAME` and `PASSWORD`, the other uses
`USER` and `PASSWD`.
To make things simpler, allow both to be configured by either, thus,
`[mailer].USERNAME` and `[mailer.PASSWORD]` will be aliases for `.USER`
and `.PASSWD`, and similarly, `[email.incoming].USER` and
`[email.incoming].PASSWD` will be aliases for `.USERNAME` and
`.PASSWORD`.
Fixes #3355.
Signed-off-by: Gergely Nagy <forgejo@gergo.csillger.hu>