Open onslowcodes opened 1 year ago
I am having the same issue. :(
See https://github.com/nextcloud/mail/blob/main/doc/admin.md#local-imap-and-smtp-servers. What's the hostname if your IMAP server?
Also same issue. It worked on my old installation, but installed a new instance. 'allow_local_remote_servers' => true, is set. but still IMAP server is not reachable. Tried FQDN and ip, nothing works
Can you tell me what version of Nextcloud and Mail you used on the old installation vs the versions used on the new?
I ran NC 25.0.2 with Mail 2.2.2, New installation was also 25.0.2 with Mail 2.2.2 , upgraded now to 25.0.3. No difference. Old installation was running for a few years, mail was already configured and working there, but with new installation I can't get it configured. Exact same as TS with almost the same setup
Can you tell me your imap server's hostname? I assume it might have to do with the changes of https://github.com/nextcloud/mail/pull/7796. Existing accoutns are not affected. New ones are.
My mailserver is xxx Running in the same internal network on a different VM. Don't see any connection attempts in the logs of the mailserver.
Thanks. The hostname is fine. It is not wrongly considered a local host.
The next steps would be
1) open the browser developer console and switch to the network tab
2) set the config.php loglevel to 0 and keep tail -f data/nextcloud.log
running while you set up the new account
3) take a screenshot of any request that fails
@ChristophWurst I did these three steps:
the errorlog shows this:
{"reqId":"VyNouFHySjZjDaXwcQUp","level":1,"time":"2023-01-25T13:48:02+00:00","remoteAddr":"46.223.163.174","user":"rapha","app":"mail","method":"POST","url":"/nextcloud/apps/mail/api/accounts","message":"Creating account failed: Connection to IMAP at imap.MYHOSTER.de:993 failed. Error connecting to mail server.","userAgent":"Mozilla/5.0 (X11; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/109.0","version":"25.0.3.2","data":{"app":"mail","error":"CONNECTION_ERROR","service":"IMAP","host":"imap.MYHOSTER.de","port":"993"}}
Thanks for your help!
@nietsmmar thanks. for your setup it looks like the connection just doesn't work but the app tries to connect.
I get the same errors as @nietsmmar
Error connecting to mail server
That is coming from the Horde IMAP library that we use. Error code is SERVER_CONNECT, documented as "Thrown if server denies the network connection".
Could it be a timeout?
To dig a little deeper
1) Add "debug" => true,
to your config.php
2) Reproduce again
3) Check the last ~30 lines in data/horde_imap.log
4) Remove debug mode again (and reset your log level from earlier too)
horde_imap.log shows the communication between the Nextcloud server and the IMAP server.
@ChristophWurst
The logs are not really giving much insights:
>> Wed, 25 Jan 2023 15:45:50 +0000
>> Connection to: imap://imap.articlett.de:993/
>> Connection failed: Error connecting to server.
>> Connection failed: Error connecting to server.
>> Connection failed: Error connecting to server.
>> Connection failed: Error connecting to server.
I don't think that this is a timeout problem as it fails directly. And also I can connect to the imap server through thunderbird etc.
Try openssl s_client -crlf -connect imap.MYHOSTER.de:993
on the Nextcloud host. I'm out of ideas here.
openssl s_client -crlf -connect imap.articlett.de:993
can establish a connection here.
openssl s_client -crlf -connect imap.articlett.de:993 can establish a connection here.
I executed it from my nextcloud host and it is able to establish a connection.
The same here, Openssl check is able to connect to the mailserver.
I am not able to trigger a Error connecting to mail server
here.
Do you use your own server or a hoster? Is there a chance that PHP isn't set up for this kind of connection?
Which version of nextcloud and mail are you using?
This is how it looks for me. I am having a mail hosting on another hoster.
I don't know @php I just installed nextcloud
by going through the install-documentation.
26/2.3.0-alpha.2 (dev setup)
I can reproduce with Nextcloud 24
php mail works for me, I get notifications from Nextcloud. But connecting to my mailbox to see my mail in the mail app doesn't work.
See https://github.com/nextcloud/mail/blob/main/doc/admin.md#local-imap-and-smtp-servers. What's the hostname if your IMAP server?
Hi thank you for your reply. Indeed I am using imap and smtp servers with a local domain e.g. (imap|smtp).mail-server.$domain.lan I did add already the line "'allow_local_remote_servers' => true," but that did not made a difference. Adding this did not made a difference. But adding timeouts and disabling peer tls verification did the trick. It seems to work now even though tls was disabled in the interface settings.
What really bugs me is that this installation worked for a long time applying many updates and suddenly it fails to initiate a new mail account. The already existing accounts continued working. Any ideas about that ?
The setup changed slightly with https://github.com/nextcloud/mail/pull/6831 and possibly some other PRs. If this introduced a regression it was not intended.
@onslowcodes could you elaborate on what settings you changed to make it work?
@onslowcodes could you elaborate on what settings you changed to make it work?
Yes I can, Like Christophwurst posted form the documentation: 'allow_local_remote_servers' => true, 'app.mail.imap.timeout' => 20, 'app.mail.smtp.timeout' => 20, 'app.mail.sieve.timeout' => 20, 'app.mail.verify-tls-peer' => false,
But again the first line allow_local_remote_servers did not made a difference in my case.
Thank you all for creating this and the care you give to the users.
The setup changed slightly with #6831 and possibly some other PRs. If this introduced a regression it was not intended.
It is okay, just would never has guessed it used to nextclouds solid performance I am used to. :)
I close this issue in a few hours if nobody has any aother questions. My problem is solved and my questions are answered.
Thanks a lot @onslowcodes, I will test if this fixes it for me too.
And of course thanks to @ChristophWurst for all the help :)
@onslowcodes That did the trick! Thanks!
It works here too! Thank you soo much.
But that means that our timeouts for the setup are too short.
But that means that our timeouts for the setup are too short.
Or it is the tls setting, either one of the two you want me to test them seperately ?
Hi, I'm getting "IMAP server is not reachable" on a Nextcloud Hub 5 (27.0.0) Virtual Machine installed from https://github.com/nextcloud/vm.
Could it be possible to configure timeouts from user interface?
I have the same issue (NextCloud 27). I have made a wireshark trace :
Seems a TLS problem (on my issue).
I came across this exact problem when the certbot certificate expires 2 months after initially setting up the email server. If you use the auto-renewal of certbot SSL certificate for your Postfix+Dovecot email server, please do remember to add the following to your renewal post hook:
systemctl reload postfix
systemctl reload dovecot
While the above is irrelevant to nextcloud, I do feel that one thing which nextcloud-mail could improve is the displaying of error messages. If the message is more direct to the point, it will make people easier to locate the problem.
Steps to reproduce
Expected behavior
I expected the mail app to reach the imap server since it is reachable there and online and manully testing proves it is from the docker container.
Actual behavior
It says imap server unreachable, and it is not sending packets to the imap server to actually test.
Mail app version
2.2.2
Mailserver or service
dovecot
Operating system
docker image Linux 3.10.0-1160.59.1.el7.x86_64
PHP engine version
PHP 7.4
Web server
Nginx
Database
MariaDB
Additional info
No response