Test connection and server settings of Email notifications

IS this, Where the Smarthost MAil settings are entered from in the UI

For use by other modules, as documented here?

SMTP smarthost | NS8 dev manual (nethserver.github.io)

if so, it does not test the email connection and server settings,

there is no way to very if sending works, by test sending an email to a designate email.

@davidep any priorities defined for these?

1 Like

We test it by login to the remote smtp server you cannot be sure that if you send the email it could be accepted by the mail server

something like this

May 31 17:03:37 R2-pve.rocky9-pve2.org crowdsec1[82547]: time="2024-05-31T15:03:37Z" level=info msg="127.0.0.1 - [Fri, 31 May 2024 15:03:37 UTC] \"GET /v1/heartbeat HTTP/1.1 200 8.819276ms \"crowdsec/v1.6.1-c6e40191\" \""
May 31 17:03:39 R2-pve.rocky9-pve2.org rspamd[52641]: (normal) <a35ac6>; task; fuzzy_check_timer_callback: got IO timeout with server fuzzy1.rspamd.com:11335(135.181.136.158:11335), after 1/1 retransmits
May 31 17:03:39 R2-pve.rocky9-pve2.org rspamd[52641]: (normal) <a35ac6>; task; finalize_item: slow rule: FUZZY_CALLBACK(323): 4005.75 ms; enable slow timer delay
May 31 17:03:39 R2-pve.rocky9-pve2.org rspamd[52641]: (normal) <a35ac6>; task; bayes_classify: not classified as ham. The ham class needs more training samples. Currently: 0; minimum 200 required
May 31 17:03:39 R2-pve.rocky9-pve2.org rspamd[52641]: (normal) <a35ac6>; task; rspamd_task_write_log: id: <wzpwx3mkok44537k-1717167815@mattermost.rocky9-pve2.org>, qid: <577F321507E1>, ip: 10.5.4.1, (default: F (no action): [2.90/15.00] [FROM_INVALID(2.00){},URI_COUNT_ODD(1.00){1;},MIME_GOOD(-0.10){multipart/alternative;text/plain;},ARC_NA(0.00){},DKIM_SIGNED(0.00){:s=default;},FROM_NO_DN(0.00){},MIME_TRACE(0.00){0:+;1:+;2:~;},MISSING_XM_UA(0.00){},PRECEDENCE_BULK(0.00){},RCPT_COUNT_ONE(0.00){1;},RCVD_COUNT_ZERO(0.00){0;},TO_DN_NONE(0.00){},TO_MATCH_ENVRCPT_ALL(0.00){}]), len: 3802, time: 4107.954ms, dns req: 14, digest: <20a1cf8e5a21e148689eaa7c2ad715a9>, rcpts: <john@foo.com>, mime_rcpts: <john@foo.com>
May 31 17:03:39 R2-pve.rocky9-pve2.org rspamd[52641]: (normal) <a35ac6>; task; rspamd_protocol_http_reply: regexp statistics: 0 pcre regexps scanned, 3 regexps matched, 176 regexps total, 42 regexps cached, 0B scanned using pcre, 4.49KiB scanned total
May 31 17:03:39 R2-pve.rocky9-pve2.org postfix/qmgr[52852]: 577F321507E1: from=<>, size=4054, nrcpt=1 (queue active)
May 31 17:03:39 R2-pve.rocky9-pve2.org rspamd[52641]: (rspamd_proxy) <063bbf>; proxy; proxy_milter_finish_handler: finished milter connection
May 31 17:03:39 R2-pve.rocky9-pve2.org postfix/smtpd[82349]: disconnect from cluster-localnode[10.5.4.1] ehlo=1 mail=1 rcpt=1 data=1 commands=4
May 31 17:03:39 R2-pve.rocky9-pve2.org postfix/smtp[83782]: Untrusted TLS connection established to smtp.ionos.fr[213.165.67.119]:587: TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256
May 31 17:03:40 R2-pve.rocky9-pve2.org postfix/smtp[83782]: 577F321507E1: to=<john@foo.com>, relay=smtp.ionos.fr[213.165.67.119]:587, delay=4.6, delays=4.2/0.01/0.44/0.03, dsn=5.0.0, status=bounced (host smtp.ionos.fr[213.165.67.119] said: 550-Requested action not taken: mailbox unavailable 550 Sender address is not allowed. (in reply to MAIL FROM command))
May 31 17:03:40 R2-pve.rocky9-pve2.org postfix/qmgr[52852]: 577F321507E1: removed

This is when I try to send an email from the console of mattermost, I can login, press the send test email button, everything is green, but my smtp provider refused it because its policy refuses that a john user sends an email as foo user

How can we trade from that point in the UI

I think the test is already implemented in the applications, like Nextcloud or Mattermost: they already provide a Test form because they are responsible for the submission with the right addresses.

The Email notifications page can only check the connection and SMTP credentials :person_shrugging: