Debian Codegraph @

doc/sources/admin/smtp.rst

raw
1 SMTP server setup
2 =================
3
4 Go in ``General Parameters`` > ``Advanced Parameters`` > ``SMTP``:
5
6
7 * **Session key containing mail address**: choose which session field contains
8 mail address
9 * **SMTP Server**: IP or hostname of the SMTP server
10 * **SMTP Port**: Port of the SMTP server
11 * **SMTP User**: SMTP user if authentication is required
12 * **SMTP Password**: SMTP password if authentication is required
13 * **SASL mechanism**: SASL mechanism(s) allowed to authenticate on the SMTP
14 server (see below)
15 * **SSL/TLS protocol** and **SSL/TLS options**: Here you can enable SMTPS or
16 startTLS. A list of possible options can be found in the `IO::Socket::SSL
17 documentation <https://metacpan.org/pod/IO::Socket::SSL>`__.
18
19 Choosing the SASL mechanism
20 ---------------------------
21
22 .. versionadded:: 2.23.3
23
24 By default, LemonLDAP::NG lets Net::SMTP choose the authentication mechanism
25 among all the mechanisms advertised by the server, and the "strongest" one is
26 selected. Some servers advertise mechanisms that do not work (``DIGEST-MD5``
27 for example), which makes authentication fail even with valid credentials.
28
29 In that case, set **SASL mechanism** (``SMTPAuthMech``) to the mechanism you
30 want to use, or to a space separated list of allowed mechanisms, for example::
31
32 PLAIN LOGIN CRAM-MD5
33
34 Only the listed mechanisms will then be tried, in the order chosen by
35 Authen::SASL among those also advertised by the server. Leave the field empty
36 to restore the default behavior.
37
38 .. warning::
39
40 The `Authen::SASL <https://metacpan.org/pod/Authen::SASL>`__ module must be
41 installed to use this parameter, and Email::Sender must be at least
42 1.300032. If this parameter is set while one of these requirements is not
43 met, the mail related plugins refuse to start, since mails would otherwise
44 be sent using another mechanism than the configured one.
45
46
47 .. tip::
48
49 - If no SMTP server is configured, the mail will be sent via the local
50 sendmail program. Else, Net::SMTP module is required to use the SMTP
51 server
52 - The SMTP server value can hold the port, for example:
53 ``mail.example.com:25``
54
55 .. warning::
56
57 - Older versions of the Email::Sender library have limitations when it comes
58 to SMTPS or STARTTLS support. Versions lower than 1.300027 will not be
59 able to check the remote server certificate or use custom IO::Socket::SSL
60 options.
61
62 - **Mail headers**:
63
64 - **Mail sender**: address seen in the "From" field (default:
65 noreply@[DOMAIN])
66 - **Reply address**: address seen in the "Reply-To" field
67 - **charset**: Charset used for the body of the mail (default:
68 utf-8)
69
70 Testing your email setup
71 ------------------------
72
73 .. versionadded:: 2.0.10
74
75 You can test your email setup in the ``General Parameters`` > ``Advanced
76 Parameters`` > ``SMTP`` page by using the ``Send test email`` button in the
77 manager.
78
79 .. tip::
80
81 You need to save your SMTP configuration before you can test it
82
83 .. versionadded:: 2.0.10
84
85 You can also test your email setup using the ``test-email`` command in the CLI ::
86
87 lemonldap-ng-cli test-email [email protected]