SSL issue - Email server and Mail app

Hello there,

I’m facing issue with Nextcloud’s Email server and the Mail app which seems to not be able to fetch the SSL certificate anymore.

Under “Settings > Basic Settings > Email Server”, I entered all the correct information to connect to my webmail server. I tried without SSL and it works. When I enabled SSL and change the port to 465 I get this error:

It is not an issue with my webmail server, it works fine as I can access my emails via SSL using another email client.

Also, the mail app was connected to the same account and used to work. However, this is no more the case, it cannot fetch email anymore. I tried removing my email account and re-adding it but I’m getting errors to connect and here is the log:

I do not know the steps to reproduce, I haven’t changed anything to my configuration in a while and it used to work fine…

System information:

Nextcloud version: 18.0.4
Operating system and version: Linux 3.10.0-962.3.2.lve1.5.32.el7.x86_64
Apache or nginx version: Apache 2.4.43
PHP version: 7.2.30

Output of config.php file:

<?php
$CONFIG = array (
  'debug' => false,
  'log_type' => 'file',
  'logfile' => 'nextcloud.log',
  'loglevel' => 1,
  'logdateformat' => 'F d, Y H:i:s',
  'instanceid' => 'xxx',
  'passwordsalt' => 'xxx',
  'secret' => 'xxx',
  'trusted_domains' =>
  array (
    0 => 'nextcloud.domain.com',
  ),
  'datadirectory' => '/home/username/nextcloud',
  'dbtype' => 'mysql',
  'version' => '18.0.4.2',
  'overwrite.cli.url' => 'https://nextcloud.domain.com/',
  'dbname' => 'username_nxtcld',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'username_nxtcld',
  'dbpassword' => 'S1-sp1u-l7',
  'installed' => true,
  'mysql.utf8mb4' => true,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => 'localhost',
    'port' => 6379,
    'timeout' => 0.0,
  ),
  'maintenance' => false,
  'updater.release.channel' => 'stable',
  'mail_from_address' => 'username',
  'mail_smtpmode' => 'smtp',
  'mail_sendmailmode' => 'smtp',
  'mail_domain' => 'domain.com',
  'mail_smtpauth' => 1,
  'mail_smtphost' => 'mail.domain.com',
  'mail_smtpport' => '465',
  'mail_smtpname' => 'username@domain.com',
  'mail_smtppassword' => 'password',
  'mail_smtpsecure' => 'ssl',
  'mail_smtpauthtype' => 'LOGIN',
  'app.mail.imap.timeout' => 30,
  'app.mail.smtp.timeout' => 30,
);

Your help is appreciated.

Ok so it was a certificate issue on my domain on the SMTP port (only), my hoster help me sort the issue.

Sorry for the trouble!