Since my hoting provider (scaleway) is blocking SMTP I want to receive a meaningful message on the logs stating that conection to the smtp server was not posible because of some network issue.
I receive a "Creating account failed: Error connecting to SMTP server."
horde_smtp.log is empty
horde_imap is alright
Mail app version: 0.6.4
Mailserver or service: Gmail
Transport security - IMAP: SSL
Transport security - SMTP: SSL
Number of accounts: 1
Operating system: debian jessie
Web server: apache
Database: mariadb 10.2
PHP version: 7.1
Version: nextcloud 12.0.0
**Updated from an older version or fresh install: fresh
{"reqId":"aITUL1qnCUhF9WfKbZkz","level":3,"time":"2017-06-03T14:32:16+00:00","remoteAddr":"172.18.0.3","user":"rodrigoaguilera","app":"mail","method":"POST","url":"\/index.php\/apps\/mail\/accounts","message":"Creating account failed: Error connecting to SMTP server.","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:53.0) Gecko\/20100101 Firefox\/53.0","version":"12.0.0.29"}
{"reqId":"A0qUowrZZcpIdwZIzJJo","level":3,"time":"2017-06-03T14:38:37+00:00","remoteAddr":"172.18.0.3","user":"rodrigoaguilera","app":"mail","method":"POST","url":"\/index.php\/apps\/mail\/accounts","message":"Creating account failed: Error connecting to SMTP server.","userAgent":"Mozilla\/5.0 (X11; Linux x86_64; rv:53.0) Gecko\/20100101 Firefox\/53.0","version":"12.0.0.29"}
First I was having auth problems with gmail but I solved those.
Can the logs give more context about what is happening?
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
5cent: This is also reproducible for other smtp accounts - my exim4 tells me:
AUTH command used when not advertised
my workaround: use a localhost smtp daemon that uses the correct one as smarthost.
my workaround: use a localhost smtp daemon that uses the correct one as smarthost.
I don't understand. Does that cloak traffic so you bypass network restrictions?
My request here is about giving more meaningful errors to be able to solve the problem that is not nextcloud's fault
I am afraid it is the fault of nextcloud mail.
when nextcloud mail tries to connect to a SMTP service it first sends the AUTH request before the EHLO requests are finished. This is not standard.
when you have a local SMTP process that accepts unauthenticated requests from localhost, you can try using this one (provided this smtp process does all the rest, like connect to just another smarthost, or send out mails directly).
As soon as the current beta release of mail works with my NC12 environment, I continue testing and will provide more info if appropriate.
I had the same error message on NextCloud 11.0.4 and mail 0.6.4 hosted by 1&1. I tried several mail accounts witch different SMTP servers and different settings with no luck. Also 1&1 support couldn't help.
The solution for me was the setting 'app.mail.transport' set to 'php-mail' in config.php as described here: https://github.com/nextcloud/mail
'app.mail.transport' => 'php-mail'
Hope this helps somenone...
when nextcloud mail tries to connect to a SMTP service it first sends the AUTH request before the EHLO requests are finished. This is not standard.
Interesting finding. Possibly the horde libs would allow us to tweak this behavior. Is this somehow related to https://github.com/nextcloud/mail/issues/489?
just another workaround: reading the complete error msg, I saw that the SMTP command had sent SSL encrypted strings before sending the EHLO stanza. This is kind of old behaviour instead of STARTTLS, but most mail installations can support it.
Connect to the ssmtp port 465 .
You can also configure exim to use ssmtp/465 by:
The upside is: you always know that SSL is started.
As there is no feedback since a while I will close this ticket. If this is still happening please make sure to upgrade to the latest version after that, feel free to reopen.
Most helpful comment
I had the same error message on NextCloud 11.0.4 and mail 0.6.4 hosted by 1&1. I tried several mail accounts witch different SMTP servers and different settings with no luck. Also 1&1 support couldn't help.
The solution for me was the setting 'app.mail.transport' set to 'php-mail' in config.php as described here: https://github.com/nextcloud/mail
Hope this helps somenone...