SMTP/Dashboards Setup
From IASO Wiki
To setup dashboard sending in ME you need to install msmtp. It is available in FreBSD ports, DEB repositories, for Windows it will be inside of ME installer.
There are a lot of new options of SMTP client:
- port — the port that the SMTP server listens on. The default port will be acquired from your operating system's service database: for SMTP, the service is "smtp" (default port 25), unless TLS without STARTTLS is used, in which case it is "ssmtp" (465). For LMTP, it is "lmtp".
- timeout (off|seconds) — set or unset a network timeout, in seconds. The argument 'off' means that no timeout will be set, which means that the operating system default will be used.
- protocol (smtp|lmtp) — set the protocol to use. Currently only SMTP and LMTP are supported. SMTP is the default. See {port} for default ports.
- domain — this command sets the argument of the SMTP EHLO (or LMTP LHLO) command. The default is 'localhost'. Possible choices are the domain part of your mail address (provider.example for joe@provider.example) or the fully qualified domain name of your host (if available).
- auth [(on|off|method)] — this command enables or disables SMTP authentication and optionally chooses an authentication method to use. It should not be necessary to choose a method; with the argument 'on', msmtp will choose the best one available. Accepted methods are 'plain', 'cram-md5', 'digest-md5', 'gssapi', 'external', 'login', and 'ntlm'.
- user — set your user name for SMTP authentication. An empty argument unsets the user name. Authentication must be activated with the 'auth' command.
- password — set your password for SMTP authentication. An empty argument unsets the password. Authentication must be activated with the 'auth' command. If no password is set but one is needed during authentication, msmtp will try to find it in ~/.netrc. If that fails, it will try to find it in SYSCONFDIR/netrc (use --version to find out what SYSCONFDIR is on your platform). If that fails, it will try to get it from a system specific keychain (if available). If that fails but a controlling terminal is available, msmtp will prompt you for it.
- ntlmdomain — set a domain for the 'ntlm' authentication method. The default is to use no domain (equivalent to an empty argument), but some servers seem to require one, even if it is an arbitrary string.
- tls [(on|off)] — this command enables or disables TLS/SSL encrypted connections to the SMTP server. Not every server supports TLS, and a few that support it require the 'tls_starttls off' command. To use TLS/SSL, it is required to either use the 'tls_trust_file' command (highly recommended) or to disable 'tls_certcheck'.
- tls_trust_file — this command activates strict server certificate verification. The given file must contain one or more certificates of trusted Certification Authorities (CAs) in PEM format. On Debian based systems, you can install the 'ca-certificates' package and use the file /etc/ssl/certs/ca-certificates.crt. An empty argument disables this feature.
- tls_crl_file — this command sets or unsets a certificate revocation list (CRL) file for TLS, to be used during strict server certificate verification as enabled by the {tls_trust_file} command. This allows the verification procedure to detect revoked certificates.
- tls_key_file — this command (together with the 'tls_cert_file') command enables msmtp to send a client certificate to the SMTP server if requested. The file must contain the private key of a certificate in PEM format. An empty argument disables this feature.
- tls_cert_file — this command (together with the 'tls_key_file' command) enables msmtp to send a client certificate to the SMTP server if requested. The file must contain a certificate in PEM format. An empty argument disables this feature.
- tls_certcheck [(on|off)] — this command enables or disables checks for the server certificate.
- tls_starttls [(on|off)] — this command enables or disables the use of the STARTTLS SMTP command to start TLS encryption. It is enabled by default.
- tls_force_sslv3 [(on|off)] — force TLS/SSL version SSLv3. This might be needed to use SSL with some old and broken servers. Do not use this unless you have to.
- tls_min_dh_prime_bits [bits] — set or unset the minimum number of Diffie-Hellman (DH) prime bits that msmtp will accept for TLS sessions. The default is set by the TLS library and can be selected by using an empty argument to this command. Only lower the default (for example to 512 bits) if there is no other way to make TLS work with the remote server.
- tls_priorities [priorities] — set the priorities for TLS sessions. The default is set by the TLS library and can be selected by using an empty argument to this command. Currently this command only works with sufficiently recent GnuTLS releases. See the GnuTLS documentation of the 'gnutls_priority_init' function for a description of the priorities string.
- auto_from [(on|off)] — enable or disable automatic envelope-from addresses. The default is 'off'. When enabled, an envelope-from address of the form user@domain will be generated. The local part will be set to USER or, if that fails, to LOGNAME or, if that fails, to the login name of the current user. The domain part can be set with the 'maildomain' command (see {maildomain}). If the maildomain is empty, the envelope-from address will only consist of the user name and not have a domain part. When disabled, the envelope-from address must be set explicitly with the 'from' command (see {from}).
- from [address] — set the envelope-from address. This address will only be used when 'auto_from' is disabled.
- maildomain [domain] — set a domain part for the generation of an envelope-from address. This is only used when 'auto_from' is enabled. The domain may be empty.
- dsn_notify (off|condition) — this command sets the condition(s) under which the mail system should send DSN (Delivery Status Notification) messages. The argument off disables explicit DSN requests, which means the mail system decides when to send DSN messages. This is the default. The condition must be 'never', to never request notification, or a comma separated list (no spaces!) of one or more of the following: 'failure', to request notification on transmission failure, 'delay', to be notified of message delays, 'success', to be notified of successful transmission. The SMTP server must support the DSN extension.
- dsn_return (off|amount) — this command controls how much of a mail should be returned in DSN (Delivery Status Notification) messages. The argument off disables explicit DSN requests, which means the mail system decides how much of a mail it returns in DSN messages. This is the default. The amount must be 'headers', to just return the message headers, or 'full', to return the full mail. The SMTP server must support the DSN extension.
- keepbcc [(on|off)] — this command controls whether to remove or keep the Bcc header when sending a mail. The default is to remove it.
- logfile [file] — this command enables or disables logging to the specified file. An empty argument disables this feature. The file name '-' directs the log information to standard output.
- syslog [(on|off|facility)] — this command enables or disables syslog logging. The facility can be one of 'LOG_USER', 'LOG_MAIL', 'LOG_LOCAL0', ..., 'LOG_LOCAL7'. The default facility is 'LOG_USER'. Syslog logging is disabled by default.
Example config:
user % cat smtp.config ## Please set smtp configuration. Symbol # (sharp) marks line as a comment host mail.iasobackup.com from support@iasobackup.com timeout 30 #port 25 #tls on #tls_certcheck off #auth on #user #SMTP username #password #SMTP password