Swift_TransportException: Connection to ssl://smtp.domeneshop.no:465 Timed Out

My Nextcloud gives me the error:

Swift_TransportException: Connection to ssl://smtp.domeneshop.no:465 Timed Out`

The email server is set up in Basic settings, and if I press the Send Email button, things seems to work fine.
But this error shows up in the log every 5 minutes.
What could cause this?

The complete error log:

`
[notifications] Error: Swift_TransportException: Connection to ssl://smtp.domeneshop.no:465 Timed Out at <>

  1. /config/www/nextcloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php line 342
    Swift_Transport_AbstractSmtpTransport->getFullResponse()
  2. /config/www/nextcloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php line 305
    Swift_Transport_AbstractSmtpTransport->executeCommand()
  3. /config/www/nextcloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php line 406
    Swift_Transport_EsmtpTransport->executeCommand()
  4. /config/www/nextcloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php line 502
    Swift_Transport_AbstractSmtpTransport->streamMessage()
  5. /config/www/nextcloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php line 518
    Swift_Transport_AbstractSmtpTransport->doMailTransaction()
  6. /config/www/nextcloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php line 206
    Swift_Transport_AbstractSmtpTransport->sendTo()
  7. /config/www/nextcloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Mailer.php line 71
    Swift_Transport_AbstractSmtpTransport->send()
  8. /config/www/nextcloud/lib/private/Mail/Mailer.php line 195
    Swift_Mailer->send()
  9. /config/www/nextcloud/apps/notifications/lib/MailNotifications.php line 217
    OC\Mail\Mailer->send()
  10. /config/www/nextcloud/apps/notifications/lib/MailNotifications.php line 168
    OCA\Notifications\MailNotifications->sendEmailToUser()
  11. /config/www/nextcloud/apps/notifications/lib/BackgroundJob/SendNotificationMails.php line 49
    OCA\Notifications\MailNotifications->sendEmails()
  12. /config/www/nextcloud/lib/public/BackgroundJob/Job.php line 79
    OCA\Notifications\BackgroundJob\SendNotificationMails->run()
  13. /config/www/nextcloud/lib/public/BackgroundJob/TimedJob.php line 95
    OCP\BackgroundJob\Job->execute()
  14. /config/www/nextcloud/cron.php line 151
    OCP\BackgroundJob\TimedJob->execute()

at 2022-11-01T13:26:24+00:00

I’m still seeing this error even after upgrading to v25.
But now the error occurs every 1 minute…
In version 25 I also see a lot of these:

Warning activity Failed sending activity email to user

When clicking the Send email button, everything works fine, but not by any means else.
I have tried configuring the same email address / password / smtp server in Thunderbird, and I can send emails just fine from there.

Strange thing is that I cannot see any trace of activity from port 465 in the firewall, except when I try the same settings from my Thunderbird mail application.

Nextcloud is running as a docker on an Unraid environment… can something be blocking port 465?
If so, why do the test email work?

Thanks