Something wrong with Swiftmailer?

Hello there.

I have a fresh installation of nextcloud (13.0.4) running on my Ubuntu 18.04 homeserver behind a Fritzbox on a default LEMP Stack.

I tried to configure Nextcloud to send emails with my posteo.de account. This is the relevant part of my config:
‘mail_domain’ => ‘MYNEXTCLOUDDOMAIN’,
‘mail_from_adress’ => ‘stefan’,
‘mail_smtpmode’ => ‘smtp’,
‘mail_smtphost’ => ‘posteo.de’,
‘mail_smtpport’ => 465’,
‘mail_smtpsecure’ => ‘ssl’,
‘mail_smtpauth’ => 1,
‘mail_smtpauthtype’ => ‘LOGIN’,
‘mail_smtptimeout’ => 30,
‘mail_smtpname’ => ‘USER@posteo.de’,
‘mail_smtppassword’ => ‘MYSECRETPASS’,

When I try to send a test email under settings, it just throws the error: email couldn’t be sent. I tried different settings, but I’m very sure that the ones above are right for posteo.

Then I looked into the nextcloud log and I saw that there are errors for swiftmailer, which seems to be the default mailing backend in nextcloud, right?

The error log is this:
Swift_TransportException: Expected response code 250 but got code “530”, with message "530 5.7.0 User not authenticated "

/var/www/nextcloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php - line 281:  Swift_Transport_AbstractSmtpTransport->_assertResponseCode('530 5.7.0 User ...', Array)
/var/www/nextcloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php - line 270: Swift_Transport_AbstractSmtpTransport->executeCommand('MAIL FROM <Stef...', Array, Array)
/var/www/nextcloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php - line 346: Swift_Transport_EsmtpTransport->executeCommand('MAIL FROM <Stef...', Array)
/var/www/nextcloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php - line 416: Swift_Transport_EsmtpTransport->_doMailFromCommand('Stefan@die-boeh...')
/var/www/nextcloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php - line 444: Swift_Transport_AbstractSmtpTransport->_doMailTransaction(Object(Swift_Message), 'Stefan@die-boeh...', Array, Array)
/var/www/nextcloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php - line 176: Swift_Transport_AbstractSmtpTransport->_sendTo(Object(Swift_Message), 'Stefan@die-boeh...', Array, Array)
/var/www/nextcloud/lib/private/Mail/Mailer.php - line 177: Swift_Transport_AbstractSmtpTransport->send(Object(Swift_Message), Array)
/var/www/nextcloud/settings/Hooks.php - line 213: OC\Mail\Mailer->send(Object(OC\Mail\Message))
/var/www/nextcloud/settings/Application.php - line 153: OC\Settings\Hooks->onChangeEmail(Object(OC\User\User), 'stefan.boehring...')
/var/www/nextcloud/lib/private/legacy/hook.php - line 106: OC\Settings\Application->onChangeInfo(Array)
/var/www/nextcloud/lib/private/Server.php - line 409: OC_Hook emit('OC_User', 'changeUser', Array)
[internal function] OC\Server->OC\{closure}(*** sensitive parameters replaced ***)
/var/www/nextcloud/lib/private/Hooks/EmitterTrait.php - line 99: call_user_func_array(Object(Closure), Array)
/var/www/nextcloud/lib/private/Hooks/PublicEmitter.php - line 36: OC\Hooks\BasicEmitter->emit('\\OC\\User', 'changeUser', Array)
/var/www/nextcloud/lib/private/User/User.php - line 456: OC\Hooks\PublicEmitter->emit('\\OC\\User', 'changeUser', Array)
/var/www/nextcloud/lib/private/User/User.php - line 170: OC\User\User->triggerChange('eMailAddress', 'stefan.boehring...', 'stefan.boehring...')
/var/www/nextcloud/settings/Controller/UsersController.php - line 860: OC\User\User->setEMailAddress('stefan.boehring...')
/var/www/nextcloud/settings/Controller/UsersController.php - line 796: OC\Settings\Controller\UsersController->saveUserSettings(Object(OC\User\User), Array)
[internal function] OC\Settings\Controller\UsersController->setUserSettings('contacts', 'Stefan', 'contacts', '017621788393', 'private', 'stefan.boehring...', 'contacts', '', 'private', '', 'private', '', 'private')
/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 161: call_user_func_array(Array, Array)
/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 91: OC\AppFramework\Http\Dispatcher->executeController(Object(OC\Settings\Controller\UsersController), 'setUserSettings')
/var/www/nextcloud/lib/private/AppFramework/App.php - line 115: OC\AppFramework\Http\Dispatcher->dispatch(Object(OC\Settings\Controller\UsersController), 'setUserSettings')
/var/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php - line 47: OC\AppFramework\App main('OC\\Settings\\Con...', 'setUserSettings', Object(OC\AppFramework\DependencyInjection\DIContainer), Array)
[internal function] OC\AppFramework\Routing\RouteActionHandler->__invoke(Array)
/var/www/nextcloud/lib/private/Route/Router.php - line 297: call_user_func(Object(OC\AppFramework\Routing\RouteActionHandler), Array)
/var/www/nextcloud/lib/base.php - line 999: OC\Route\Router->match('/settings/users...')
/var/www/nextcloud/index.php - line 42: OC handleRequest()
{main}

How can I fix this error?

is your problem related to this?