I’m running the default/latest image of Nextcloud in docker, behind an nginx proxy.
Everything runs like a top, except for email.
My SMTP server is a mail-in-a-box server hosted on seperate public network.
In Basic Settings → Email Server, I entered my SMTP server settings (Used the domain name for the server address), click the “send email” button to test the settings, and I get an email from the system’s given email account. - Everything looks good.
However the system does not sent out new user emails or link share emails.
I checked the log and it looks like it’s trying to use 127.0.0.1 for the SMTP server address.
{"reqId":"6J7uYswC2ZfdDVwLBZIy","level":3,"time":"2022-01-12T02:50:17+00:00","remoteAddr":"172.21.0.2","user":"redacted","app":"ocs_api","method":"POST","url":"/ocs/v2.php/cloud/users","message":"Unable to send the invitation mail to user@redacted.com","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36","version":"23.0.0.10","exception":{"Exception":"Swift_TransportException","Message":"Connection could not be established with host 127.0.0.1 :stream_socket_client(): Unable to connect to 127.0.0.1:25 (Connection refused)","Code":0,"Trace":[{"function":"{closure}","class":"Swift_Transport_StreamBuffer","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php","line":264,"function":"stream_socket_client","args":["127.0.0.1:25",0,"",10,4,null]},{"file":"/var/www/html/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php","line":58,"function":"establishSocketConnection","class":"Swift_Transport_StreamBuffer","type":"->","args":[]},{"file":"/var/www/html/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php","line":143,"function":"initialize","class":"Swift_Transport_StreamBuffer","type":"->","args":[{"protocol":"","host":"127.0.0.1","port":25,"timeout":10,"blocking":1,"0":"And 3 more entries, set log level to debug to see all entries"}]},{"file":"/var/www/html/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Mailer.php","line":65,"function":"start","class":"Swift_Transport_AbstractSmtpTransport","type":"->","args":[]},{"file":"/var/www/html/lib/private/Mail/Mailer.php","line":204,"function":"send","class":"Swift_Mailer","type":"->","args":[{"__class__":"Swift_Message"},"*** sensitive parameter replaced ***"]},{"file":"/var/www/html/apps/settings/lib/Mailer/NewUserMailHelper.php","line":184,"function":"send","class":"OC\\Mail\\Mailer","type":"->","args":[{"__class__":"OC\\Mail\\Message"}]},{"file":"/var/www/html/apps/provisioning_api/lib/Controller/UsersController.php","line":446,"function":"sendMail","class":"OCA\\Settings\\Mailer\\NewUserMailHelper","type":"->","args":[{"__class__":"OC\\User\\User"},{"__class__":"OC\\Mail\\EMailTemplate"}]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":217,"function":"addUser","class":"OCA\\Provisioning_API\\Controller\\UsersController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/html/lib/private/AppFramework/Http/Dispatcher.php","line":126,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Provisioning_API\\Controller\\UsersController"},"addUser"]},{"file":"/var/www/html/lib/private/AppFramework/App.php","line":157,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->","args":[{"__class__":"OCA\\Provisioning_API\\Controller\\UsersController"},"addUser"]},{"file":"/var/www/html/lib/private/Route/Router.php","line":302,"function":"main","class":"OC\\AppFramework\\App","type":"::","args":["OCA\\Provisioning_API\\Controller\\UsersController","addUser",{"__class__":"OC\\AppFramework\\DependencyInjection\\DIContainer"},{"_route":"ocs.provisioning_api.Users.addUser"}]},{"file":"/var/www/html/ocs/v1.php","line":62,"function":"match","class":"OC\\Route\\Router","type":"->","args":["/ocsapp/cloud/users"]},{"file":"/var/www/html/ocs/v2.php","line":23,"args":["/var/www/html/ocs/v1.php"],"function":"require_once"}],"File":"/var/www/html/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php","Line":261,"CustomMessage":"Unable to send the invitation mail to user@redacted.com"}}
Any Ideas where to look?