nextcloud / mail

💌 Mail app for Nextcloud
https://apps.nextcloud.com/apps/mail
GNU Affero General Public License v3.0
844 stars 260 forks source link

Mail unable to discover configuration for mail accounts #9047

Open bustinbung opened 1 year ago

bustinbung commented 1 year ago

Steps to reproduce

  1. Create VPS through Oracle Cloud using Ubuntu 22.04
  2. Install Hestia CP (v1.8.10)
  3. Set up mail servers using dovecot/exim4
  4. Create a mail domain and configure DNS, DKIM, SPF, etc.
  5. Set up SMTP relay via Oracle Email Delivery and configure within Hestia
  6. Login to the new account through the Nextcloud Mail app
  7. Receive error "Configuration discovery failed"

Expected behavior

The Mail app should be able to detect and login to the mail servers.

Actual behavior

I receive the error above.

Mail app version

3.4.4

Mailserver or service

Self-Hosted (dovecot/exim4)

Operating system

Ubuntu

PHP engine version

PHP 8.2

Web server

Apache (supported)

Database

MariaDB

Additional info

I've tried adding the account to other third-party mail apps and it works fine, same for the webmail interface through RoundTable, so I think it may be a Nextcloud Mail issue. The admin logs give this error which may be useful:

{"reqId":"sOHPETP2bQ5XUqGsiFtw","level":3,"time":"2023-11-02T08:59:36+00:00","remoteAddr":"10.0.0.34","user":"justin","app":"PHP","method":"GET","url":"/index.php/apps/mail/api/autoconfig/mx/justin%40bustinbung.com","message":"Undefined array key 1 at /home/justin/web/cloud.bustinbung.com/public_html/lib/private/AppFramework/Utility/ControllerMethodReflector.php#65","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/118.0.0.0 Safari/537.36","version":"27.1.3.2","data":{"app":"PHP"},"id":"65436568692c0"}ne
[PHP] Error: Undefined array key 1 at /home/justin/web/cloud.bustinbung.com/public_html/lib/private/AppFramework/Utility/ControllerMethodReflector.php#65

GET /index.php/apps/mail/api/autoconfig/mx/justin%40bustinbung.com
from 10.0.0.34 by justin at 2023-11-02T08:59:36+00:00

EDIT: Tried to login using other mail services, and am getting the same errors. Still no issues with other mail clients however.

joshtrichards commented 10 months ago

Similar: #9170 and nextcloud/server#42348

winicius87 commented 3 months ago

I'm trying to connect my email account with Auto, but I'm getting this error: Configuration discovery failed. Please use the manual settings.

I have attached my config that works when I manually put it in Manual. How do I resolve this? I think the problem is with line 517.

mail/src/components/AccountForm.vue Line 517 const firstImapHost = results.filter(({ canConnect, port }) => canConnect && port === 993)[0] const firstSmtpHost = results.filter(({ canConnect, port }) => canConnect && [465, 587].includes(port))[0]

'app.mail.accounts.default' => [
'email' => '%EMAIL%',
'imapHost' => '127.0.0.1',
'imapPort' => 143, 'imapUser' => '%EMAIL%', 'imapSslMode' => 'none' , 'smtpHost' => 'isellemails.com', 'smtpPort' => 465, 'smtpUser' => '%EMAIL%', 'smtpsslMode' => 'ssl', ],

ChristophWurst commented 3 months ago

@winicius87 please use https://help.nextcloud.com/c/apps/mail/35 for support questions.