NS8: nextcloud not able to send mails

I installed nextcloud in a nethserver RC1 installation, and tried to configure a Mail Server for notifications in admin / Basic Settings. However, whatever Mailserver I enter, nextcloud is not able to connect to it. It neither works when I enter the FQDN of the NS8 machine (which runs the Mail app), nor does it work when I select another mail server in my local network.
Nextcloud reports an error when trying to connect to the mail server. The mail server logs show no data at all - i.e., not even a connection attempt.
Can you please fix this such that nextcloud can send status notifications via smtp?

Nextcloud as other apps that need an SMTP server to send notifications should honor the Email notification settings, formerly named Smarthost.

See Modules — NS8 documentation

The Mail module is not needed in this scenario: you can remove it.

It is planned to integrate Mail with the Email notification settings so that it can be configured as the SMTP host for the notifications sent by apps in the whole cluster.

Thank you. How do I need to configure the Email notification in case I do want to use the Mail app within nextcloud as a mailserver? When I enter the FQDN of my NS8 server with port 25 or 587, it is not working from within the nextcloud app. What I did:

  1. Set EMail notifications in NS8 settings to FQDN of NS8 server, port 25/587 (both show the same behavior), smtp-encryption none, no user, no password.
  2. apply settings
  3. Login to nextcloud as admin
  4. In nextcloud, go to settings/personal settings, and enter admin E-Mail address.
  5. In nextcloud, go to Administrative settings / Basic settings
  6. Within the mail server configuration of nextcloud, I find the settings from step 1 - good.
  7. Press the button to send a test email.
  8. Result is an error message in nextcloud that mail could not be sent.
  9. Logs from the mail app in NS8 show nothing, not even a connection to port 25/587.

When I repeat the same steps with another mail server in my local network (not the NS8 server), mails can be sent successfully from within nextcloud.

Your procedure seems good, but FQDN can’t work because 127.0.1.1 is not reachable within Nextcloud container pod.

As alternative, use the node IP address of the cluster VPN. You find it in the Nodes page.

Thank you. However, I will do not get it to work. Using the cluster IP address shows a connection attempt in the mail server log, however, it fails with the following entries in the mail server log:

2023-12-30T17:15:53+01:00 [1:mail1:postfix/postscreen] CONNECT from [10.5.4.1]:51002 to [10.5.4.1]:25
2023-12-30T17:15:53+01:00 [1:mail1:postfix/postscreen] ALLOWLISTED [10.5.4.1]:51002
2023-12-30T17:15:53+01:00 [1:mail1:postfix/smtpd] connect from cluster-localnode[10.5.4.1]
2023-12-30T17:15:53+01:00 [1:mail1:postfix/smtpd] SSL_accept error from cluster-localnode[10.5.4.1]: -1
2023-12-30T17:15:53+01:00 [1:mail1:postfix/smtpd] lost connection after STARTTLS from cluster-localnode[10.5.4.1]
2023-12-30T17:15:53+01:00 [1:mail1:rspamd] #25(rspamd_proxy) ; proxy; proxy_milter_finish_handler: finished milter connection

Which other settings do I have to use to enable the mail app in NS8 for E-Mail notifications?

1 Like

Try to disable TLS, and also SMTP authentication.

I tried it by myself and I get the same error. It might be a NC configuration issue: filed a card here

5 Likes

it seems we need to not verify the certificate, we have this option inside the smarthost settings but nothing to honor it inside nextcloud configuration, moreover we have to use the internal IP of mail endpoint and not the FQDN

I can send email when I add to the nextcloud configuration, I continue to dive

"mail_smtpstreamoptions" => array(
    'ssl' => array(
        'allow_self_signed' => true,
        'verify_peer' => false,
        'verify_peer_name' => false
    )

https://docs.nextcloud.com/server/16/admin_manual/configuration_server/email_configuration.html#troubleshooting

1 Like

@davidep

bug or feature I cannot set a smarthost to our mail module without SMARTTLS

workable with starttls

2 Likes

Should be fixed in this Nextcloud release

Btw look also at this discussion about Email notifications with the Mail module