After Update Nextcloud - sending mail did not work anymore with IPV6

Hello all,

we are useing Nextcloud with Univention Server. Arfter the Update to the latest Version 18.0.4, we can’t send shares over mail any more. The got an error.

After an analysis i found out that nextcloud cant find out the mailserver anymore with ipv6. So for workaround i added an IPV4 too. But strange why it can’t conntact the mailserver over ipv6… here is the error Log from the nextcloud webinterface. Maybe some know the problem.

[sharebymail] Error: Swift_TransportException: Connection could not be established with host smtp.osit.cc :stream_socket_client(): unable to connect to tcp://smtp.osit.cc:25 (Cannot assign requested address) at <>

 0. <<closure>>
    Swift_Transport_StreamBuffer->{closure}("*** sensitive parameters replaced ***")
 1. /var/www/html/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php line 272
    stream_socket_client("tcp://smtp.osit.cc:25", 99, "Cannot assign requested address", 10, 4, null)
 2. /var/www/html/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php line 58
    Swift_Transport_StreamBuffer->establishSocketConnection()
 3. /var/www/html/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php line 143
    Swift_Transport_StreamBuffer->initialize({protocol: "tcp" ... ]})
 4. /var/www/html/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Mailer.php line 65
    Swift_Transport_AbstractSmtpTransport->start()
 5. /var/www/html/lib/private/Mail/Mailer.php line 192
    Swift_Mailer->send(Swift_Message {}, [])
 6. /var/www/html/apps/sharebymail/lib/ShareByMailProvider.php line 456
    OC\Mail\Mailer->send(OC\Mail\Message {})
 7. /var/www/html/apps/sharebymail/lib/ShareByMailProvider.php line 368
    OCA\ShareByMail\ShareByMailProvider->sendMailNotification("Mit integrierte ... s", "https://darkdev ... R", "loma", "mario.loderer@iteas.at", null)
 8. /var/www/html/apps/sharebymail/lib/ShareByMailProvider.php line 195
    OCA\ShareByMail\ShareByMailProvider->createMailShare(OC\Share20\Share {})
 9. /var/www/html/lib/private/Share20/Manager.php line 787
    OCA\ShareByMail\ShareByMailProvider->create(OC\Share20\Share {})
10. /var/www/html/apps/files_sharing/lib/Controller/ShareAPIController.php line 576
    OC\Share20\Manager->createShare(OC\Share20\Share {})
11. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 170
    OCA\Files_Sharing\Controller\ShareAPIController->createShare(OC\Files\Node\File {}, 19, 4, "mario.loderer@iteas.at", "false", "", null, "", "")
12. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 99
    OC\AppFramework\Http\Dispatcher->executeController(OCA\Files_Sharin ... {}, "createShare")
13. /var/www/html/lib/private/AppFramework/App.php line 125
    OC\AppFramework\Http\Dispatcher->dispatch(OCA\Files_Sharin ... {}, "createShare")
14. /var/www/html/lib/private/AppFramework/Routing/RouteActionHandler.php line 47
    OC\AppFramework\App::main("OCA\\Files_Shar ... r", "createShare", OC\AppFramework\ ... {}, {_route: "ocs.fi ... "})
15. <<closure>>
    OC\AppFramework\Routing\RouteActionHandler->__invoke({_route: "ocs.fi ... "})
16. /var/www/html/lib/private/Route/Router.php line 299
    call_user_func(OC\AppFramework\ ... {}, {_route: "ocs.fi ... "})
17. /var/www/html/ocs/v1.php line 82
    OC\Route\Router->match("/ocsapp/apps/fi ... s")
18. /var/www/html/ocs/v2.php line 24
    require_once("/var/www/html/ocs/v1.php")

POST /nextcloud/ocs/v2.php/apps/files_sharing/api/v1/shares

Very Thanks and best Regards :slight_smile:

Hi, this seems to be an issue with SwiftMailer, however, they seem to have fixed this already:

Maybe it’s worth opening a ticket against NC server? https://github.com/nextcloud/server/issues