Mail cannot open message from IMAP ProtonMail Bridge

Versions:
NextCloud from the Hansson IT image
Ubuntu 20.04
NextCloud 20.05
NextCloud Mail 1.8.0
ProtonMail Bridge 1.5.4
Apache 2.4.41
PHP version 7.4.3-4

The issue you are facing:
Mail, using ProtonMail Bridge can load list of messages by box, can load message subject in preview pane, but cannot load body of email message.

Any help offered is greatly appreciated.

Is this the first time you’ve seen this error? : Y

Steps to replicate it:

Proton Mail Bridge is configured to successfully connect to supported account type (two factor removed just in case).
NextCloud User’s Mail settings under [Manual ]

IMAP Host : 127.0.0.1
IMAP Security : StartTLS
IMAP Port : 1143
Username / Password verified against Bridge config

SMTP Host : 127.0.0.1
SMTP Security : StartTLS
SMTP Port : 1025
Username / Password verfied against Bridge config
  1. Save config.
  2. Click on InBox.
  3. UI shows list of emails, along with icons to the left.
  4. Select a message from the list, UI shows Message Subject in the preview pane, nothing more.
  5. Click the subject in the preview pane to expand the message to view the Body, the spinning circle starts and never ends.

NextCloud Log

Error	mail	OCA\Mail\Exception\ServiceException: Could not load message
    /var/www/nextcloud/apps/mail/lib/Controller/MessagesController.php - line 249:
    OCA\Mail\Service\MailManager->getImapMessage()
    /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 169:
    OCA\Mail\Controller\MessagesController->getBody()
    /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 100:
    OC\AppFramework\Http\Dispatcher->executeController()
    /var/www/nextcloud/lib/private/AppFramework/App.php - line 152:
    OC\AppFramework\Http\Dispatcher->dispatch()
    /var/www/nextcloud/lib/private/Route/Router.php - line 309:
    OC\AppFramework\App::main()
    /var/www/nextcloud/lib/base.php - line 1008:
    OC\Route\Router->match()
    /var/www/nextcloud/index.php - line 37:
    OC::handleRequest()
Caused by OCP\AppFramework\Db\DoesNotExistException: Mail body for this mail(7) could not be loaded
    /var/www/nextcloud/apps/mail/lib/Model/IMAPMessage.php - line 550:
    OCA\Mail\Model\IMAPMessage->loadBodyData()
    /var/www/nextcloud/apps/mail/lib/Model/IMAPMessage.php - line 424:
    OCA\Mail\Model\IMAPMessage->handleHtmlMessage()
    /var/www/nextcloud/apps/mail/lib/Model/IMAPMessage.php - line 373:
    OCA\Mail\Model\IMAPMessage->getPart()
    /var/www/nextcloud/apps/mail/lib/Model/IMAPMessage.php - line 94:
    OCA\Mail\Model\IMAPMessage->loadMessageBodies()
    /var/www/nextcloud/apps/mail/lib/IMAP/MessageMapper.php - line 222:
    OCA\Mail\Model\IMAPMessage->__construct()
    <<closure>>
    OCA\Mail\IMAP\MessageMapper->OCA\Mail\IMAP\{closure}("*** sensiti ... *")
    /var/www/nextcloud/apps/mail/lib/IMAP/MessageMapper.php - line 236:
    array_map()
    /var/www/nextcloud/apps/mail/lib/IMAP/MessageMapper.php - line 64:
    OCA\Mail\IMAP\MessageMapper->findByIds()
    /var/www/nextcloud/apps/mail/lib/Service/MailManager.php - line 182:
    OCA\Mail\IMAP\MessageMapper->find()
    /var/www/nextcloud/apps/mail/lib/Controller/MessagesController.php - line 249:
    OCA\Mail\Service\MailManager->getImapMessage()
    /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 169:
    OCA\Mail\Controller\MessagesController->getBody()
    /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 100:
    OC\AppFramework\Http\Dispatcher->executeController()
    /var/www/nextcloud/lib/private/AppFramework/App.php - line 152:
    OC\AppFramework\Http\Dispatcher->dispatch()
    /var/www/nextcloud/lib/private/Route/Router.php - line 309:
    OC\AppFramework\App::main()
    /var/www/nextcloud/lib/base.php - line 1008:
    OC\Route\Router->match()
    /var/www/nextcloud/index.php - line 37:
    OC::handleRequest()
2021-01-20T18:59:13-0600
Error	mail	OCA\Mail\Exception\ServiceException: IMAP error: Error connecting to mail server.
    /var/www/nextcloud/apps/mail/lib/Service/MailManager.php - line 128:
    OCA\Mail\IMAP\MailboxSync->sync()
    /var/www/nextcloud/apps/mail/lib/Controller/PageController.php - line 119:
    OCA\Mail\Service\MailManager->getMailboxes()
    /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 169:
    OCA\Mail\Controller\PageController->index()
    /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 100:
    OC\AppFramework\Http\Dispatcher->executeController()
    /var/www/nextcloud/lib/private/AppFramework/App.php - line 152:
    OC\AppFramework\Http\Dispatcher->dispatch()
    /var/www/nextcloud/lib/private/Route/Router.php - line 309:
    OC\AppFramework\App::main()
    /var/www/nextcloud/lib/base.php - line 1008:
    OC\Route\Router->match()
    /var/www/nextcloud/index.php - line 37:
    OC::handleRequest()
Caused by Horde_Imap_Client_Exception: Error connecting to mail server.
    /var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php - line 375:
    Horde_Imap_Client_Socket->_connect()
    /var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Base.php - line 838:
    Horde_Imap_Client_Socket->_login("*** sensiti ... *")
    /var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Base.php - line 1389:
    Horde_Imap_Client_Base->login("*** sensiti ... *")
    /var/www/nextcloud/apps/mail/lib/IMAP/FolderMapper.php - line 60:
    Horde_Imap_Client_Base->listMailboxes()
    /var/www/nextcloud/apps/mail/lib/IMAP/MailboxSync.php - line 103:
    OCA\Mail\IMAP\FolderMapper->getFolders()
    /var/www/nextcloud/apps/mail/lib/Service/MailManager.php - line 128:
    OCA\Mail\IMAP\MailboxSync->sync()
    /var/www/nextcloud/apps/mail/lib/Controller/PageController.php - line 119:
    OCA\Mail\Service\MailManager->getMailboxes()
    /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 169:
    OCA\Mail\Controller\PageController->index()
    /var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php - line 100:
    OC\AppFramework\Http\Dispatcher->executeController()
    /var/www/nextcloud/lib/private/AppFramework/App.php - line 152:
    OC\AppFramework\Http\Dispatcher->dispatch()
    /var/www/nextcloud/lib/private/Route/Router.php - line 309:
    OC\AppFramework\App::main()
    /var/www/nextcloud/lib/base.php - line 1008:
    OC\Route\Router->match()
    /var/www/nextcloud/index.php - line 37:
    OC::handleRequest()

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

$CONFIG = array (
  'passwordsalt' => '---removed---',
  'secret' => '---removed---',
  'trusted_domains' =>
  array (
    0 => 'localhost',
    1 => '192.X.X.X',
    2 => '---removed---',
    3 => '---removed---',
  ),
  'datadirectory' => '/mnt/ncdata',
  'dbtype' => 'pgsql',
  'version' => '20.0.5.2',
  'overwrite.cli.url' => 'https://---removed---/',
  'overwritehost'=>'---removed---',
  'overwriteprotocol' => 'https',
  'dbname' => 'nextcloud_db',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'ncadmin',
  'dbpassword' => '---removed---',
  'installed' => true,
  'instanceid' => '---removed---',
  'upgrade.disable-web' => 'true',
  'log_type' => 'file',
  'logfile' => '/var/log/nextcloud/nextcloud.log',
  'loglevel' => '2',
  'log.condition' =>
  array (
    'apps' =>
    array (
      0 => 'admin_audit',
    ),
  ),
  'mail_smtpmode' => 'smtp',
  'remember_login_cookie_lifetime' => '1800',
  'log_rotate_size' => '0',
  'trashbin_retention_obligation' => 'auto, 180',
  'versions_retention_obligation' => 'auto, 365',
  'simpleSignUpLink.shown' => false,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'filelocking.enabled' => true,
  'memcache.distributed' => '\\OC\\Memcache\\Redis',
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' =>
  array (
    'host' => '/var/run/redis/redis-server.sock',
    'port' => 0,
    'timeout' => 0.5,
    'dbindex' => 0,
    'password' => '---removed---',
  ),
  'logtimezone' => 'America/Chicago',
  'htaccess.RewriteBase' => '/',
  'enable_previews' => true,
  'enabledPreviewProviders' =>
  array (    
    0 => 'OC\\Preview\\PNG',
    1 => 'OC\\Preview\\JPEG',
    2 => 'OC\\Preview\\GIF',
    3 => 'OC\\Preview\\BMP',
    4 => 'OC\\Preview\\MarkDown',
    5 => 'OC\\Preview\\MP3',
    6 => 'OC\\Preview\\TXT',
    7 => 'OC\\Preview\\Movie',
    8 => 'OC\\Preview\\Photoshop',
    9 => 'OC\\Preview\\SVG',
    10 => 'OC\\Preview\\TIFF',
  ),
  'preview_max_x' => '2048',
  'preview_max_y' => '2048',
  'jpeg_quality' => '60',
  'maintenance' => false,
  'mail_sendmailmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'app.mail.verify-tls-peer' => false,
  'app.mail.imap.timeout' => 20,
  'app.mail.smtp.timeout' => 2
);

I’ve gathered some more information. Deeper log entries around a test session. It would appear that NextCloud is trying to interact with something at 192.168.0.1, which is a UBNT Secure Gateway and I dont think its going to respond with anything interesting to NextCloud Mail. NextCloud server is at 192.168.0.8 and it should be addressing the bridge at 127.0.0.1, not 192.168.0.1. I’ve looked again at the config.php and did not see an ip address other than the loopback.

Log from jq conversion of the NextCloud log follows:

{
  "reqId": "gf9AOkqQnGcpnS1yLOax",
  "level": 3,
  "time": "2021-01-24T09:39:56-06:00",
  "remoteAddr": "192.168.0.1",
  "user": "[USERNAME REMOVED]",
  "app": "mail",
  "method": "GET",
  "url": "/apps/mail/",
  "message": {
    "Exception": "OCA\\Mail\\Exception\\ServiceException",
    "Message": "IMAP error: Error connecting to mail server.",
    "Code": 11,
    "Trace": [
      {
        "file": "/var/www/nextcloud/apps/mail/lib/Service/MailManager.php",
        "line": 128,
        "function": "sync",
        "class": "OCA\\Mail\\IMAP\\MailboxSync",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/mail/lib/Controller/PageController.php",
        "line": 119,
        "function": "getMailboxes",
        "class": "OCA\\Mail\\Service\\MailManager",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 169,
        "function": "index",
        "class": "OCA\\Mail\\Controller\\PageController",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 100,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
        "line": 152,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Route/Router.php",
        "line": 309,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::"
      },
      {
        "file": "/var/www/nextcloud/lib/base.php",
        "line": 1008,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/index.php",
        "line": 37,
        "function": "handleRequest",
        "class": "OC",
        "type": "::"
      }
    ],
    "File": "/var/www/nextcloud/apps/mail/lib/IMAP/MailboxSync.php",
    "Line": 106,
    "Previous": {
      "Exception": "Horde_Imap_Client_Exception",
      "Message": "Error connecting to mail server.",
      "Code": 11,
      "Trace": [
        {
          "file": "/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php",
          "line": 375,
          "function": "_connect",
          "class": "Horde_Imap_Client_Socket",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Base.php",
          "line": 838,
          "function": "_login",
          "class": "Horde_Imap_Client_Socket",
          "type": "->",
          "args": [
            "*** sensitive parameters replaced ***"
          ]
        },
        {
          "file": "/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Base.php",
          "line": 1389,
          "function": "login",
          "class": "Horde_Imap_Client_Base",
          "type": "->",
          "args": [
            "*** sensitive parameters replaced ***"
          ]
        },
        {
          "file": "/var/www/nextcloud/apps/mail/lib/IMAP/FolderMapper.php",
          "line": 60,
          "function": "listMailboxes",
          "class": "Horde_Imap_Client_Base",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/lib/IMAP/MailboxSync.php",
          "line": 103,
          "function": "getFolders",
          "class": "OCA\\Mail\\IMAP\\FolderMapper",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/lib/Service/MailManager.php",
          "line": 128,
          "function": "sync",
          "class": "OCA\\Mail\\IMAP\\MailboxSync",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/lib/Controller/PageController.php",
          "line": 119,
          "function": "getMailboxes",
          "class": "OCA\\Mail\\Service\\MailManager",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
          "line": 169,
          "function": "index",
          "class": "OCA\\Mail\\Controller\\PageController",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
          "line": 100,
          "function": "executeController",
          "class": "OC\\AppFramework\\Http\\Dispatcher",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
          "line": 152,
          "function": "dispatch",
          "class": "OC\\AppFramework\\Http\\Dispatcher",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/Route/Router.php",
          "line": 309,
          "function": "main",
          "class": "OC\\AppFramework\\App",
          "type": "::"
        },
        {
          "file": "/var/www/nextcloud/lib/base.php",
          "line": 1008,
          "function": "match",
          "class": "OC\\Route\\Router",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/index.php",
          "line": 37,
          "function": "handleRequest",
          "class": "OC",
          "type": "::"
        }
      ],
      "File": "/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php",
      "Line": 605
    },
    "CustomMessage": "Could not load account mailboxes: IMAP error: Error connecting to mail server."
  },
  "userAgent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0",
  "version": "20.0.5.2"
}
{
  "reqId": "kzmVA02Ul4ffguBTCu99",
  "level": 3,
  "time": "2021-01-24T09:40:02-06:00",
  "remoteAddr": "192.168.0.1",
  "user": "[USERNAME REMOVED]",
  "app": "mail",
  "method": "GET",
  "url": "/apps/mail/api/messages/120/body",
  "message": {
    "Exception": "OCA\\Mail\\Exception\\ServiceException",
    "Message": "Could not load message",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/nextcloud/apps/mail/lib/Controller/MessagesController.php",
        "line": 249,
        "function": "getImapMessage",
        "class": "OCA\\Mail\\Service\\MailManager",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 169,
        "function": "getBody",
        "class": "OCA\\Mail\\Controller\\MessagesController",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 100,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
        "line": 152,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Route/Router.php",
        "line": 309,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::"
      },
      {
        "file": "/var/www/nextcloud/lib/base.php",
        "line": 1008,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/index.php",
        "line": 37,
        "function": "handleRequest",
        "class": "OC",
        "type": "::"
      }
    ],
    "File": "/var/www/nextcloud/apps/mail/lib/Service/MailManager.php",
    "Line": 188,
    "Previous": {
      "Exception": "OCP\\AppFramework\\Db\\DoesNotExistException",
      "Message": "Mail body for this mail(7) could not be loaded",
      "Code": 0,
      "Trace": [
        {
          "file": "/var/www/nextcloud/apps/mail/lib/Model/IMAPMessage.php",
          "line": 550,
          "function": "loadBodyData",
          "class": "OCA\\Mail\\Model\\IMAPMessage",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/lib/Model/IMAPMessage.php",
          "line": 424,
          "function": "handleHtmlMessage",
          "class": "OCA\\Mail\\Model\\IMAPMessage",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/lib/Model/IMAPMessage.php",
          "line": 373,
          "function": "getPart",
          "class": "OCA\\Mail\\Model\\IMAPMessage",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/lib/Model/IMAPMessage.php",
          "line": 94,
          "function": "loadMessageBodies",
          "class": "OCA\\Mail\\Model\\IMAPMessage",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/lib/IMAP/MessageMapper.php",
          "line": 222,
          "function": "__construct",
          "class": "OCA\\Mail\\Model\\IMAPMessage",
          "type": "->"
        },
        {
          "function": "OCA\\Mail\\IMAP\\{closure}",
          "class": "OCA\\Mail\\IMAP\\MessageMapper",
          "type": "->",
          "args": [
            "*** sensitive parameters replaced ***"
          ]
        },
        {
          "file": "/var/www/nextcloud/apps/mail/lib/IMAP/MessageMapper.php",
          "line": 236,
          "function": "array_map"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/lib/IMAP/MessageMapper.php",
          "line": 64,
          "function": "findByIds",
          "class": "OCA\\Mail\\IMAP\\MessageMapper",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/lib/Service/MailManager.php",
          "line": 182,
          "function": "find",
          "class": "OCA\\Mail\\IMAP\\MessageMapper",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/lib/Controller/MessagesController.php",
          "line": 249,
          "function": "getImapMessage",
          "class": "OCA\\Mail\\Service\\MailManager",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
          "line": 169,
          "function": "getBody",
          "class": "OCA\\Mail\\Controller\\MessagesController",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
          "line": 100,
          "function": "executeController",
          "class": "OC\\AppFramework\\Http\\Dispatcher",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
          "line": 152,
          "function": "dispatch",
          "class": "OC\\AppFramework\\Http\\Dispatcher",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/Route/Router.php",
          "line": 309,
          "function": "main",
          "class": "OC\\AppFramework\\App",
          "type": "::"
        },
        {
          "file": "/var/www/nextcloud/lib/base.php",
          "line": 1008,
          "function": "match",
          "class": "OC\\Route\\Router",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/index.php",
          "line": 37,
          "function": "handleRequest",
          "class": "OC",
          "type": "::"
        }
      ],
      "File": "/var/www/nextcloud/apps/mail/lib/Model/IMAPMessage.php",
      "Line": 580
    },
    "CustomMessage": "Could not load message"
  },
  "userAgent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0",
  "version": "20.0.5.2"
}
{
  "reqId": "wyKf0AHz44Qc3z1k1mtd",
  "level": 3,
  "time": "2021-01-24T09:40:27-06:00",
  "remoteAddr": "192.168.0.1",
  "user": "[USERNAME REMOVED]",
  "app": "mail",
  "method": "POST",
  "url": "/apps/mail/api/mailboxes/22/sync",
  "message": {
    "Exception": "OCA\\Mail\\Exception\\ServiceException",
    "Message": "Sync failed for 3:INBOX: Error connecting to mail server.",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/nextcloud/apps/mail/lib/Service/Sync/SyncService.php",
        "line": 121,
        "function": "sync",
        "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/mail/lib/Controller/MailboxesController.php",
        "line": 161,
        "function": "syncMailbox",
        "class": "OCA\\Mail\\Service\\Sync\\SyncService",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 169,
        "function": "sync",
        "class": "OCA\\Mail\\Controller\\MailboxesController",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 100,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
        "line": 152,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Route/Router.php",
        "line": 309,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::"
      },
      {
        "file": "/var/www/nextcloud/lib/base.php",
        "line": 1008,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/index.php",
        "line": 37,
        "function": "handleRequest",
        "class": "OC",
        "type": "::"
      }
    ],
    "File": "/var/www/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
    "Line": 238,
    "Previous": {
      "Exception": "Horde_Imap_Client_Exception",
      "Message": "Error connecting to mail server.",
      "Code": 11,
      "Trace": [
        {
          "file": "/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php",
          "line": 375,
          "function": "_connect",
          "class": "Horde_Imap_Client_Socket",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Base.php",
          "line": 838,
          "function": "_login",
          "class": "Horde_Imap_Client_Socket",
          "type": "->",
          "args": [
            "*** sensitive parameters replaced ***"
          ]
        },
        {
          "file": "/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Base.php",
          "line": 1598,
          "function": "login",
          "class": "Horde_Imap_Client_Base",
          "type": "->",
          "args": [
            "*** sensitive parameters replaced ***"
          ]
        },
        {
          "file": "/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Base.php",
          "line": 4038,
          "function": "status",
          "class": "Horde_Imap_Client_Base",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Base.php",
          "line": 3632,
          "function": "_syncStatus",
          "class": "Horde_Imap_Client_Base",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/lib/IMAP/Sync/Synchronizer.php",
          "line": 109,
          "function": "sync",
          "class": "Horde_Imap_Client_Base",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/lib/IMAP/Sync/Synchronizer.php",
          "line": 65,
          "function": "getNewMessageUids",
          "class": "OCA\\Mail\\IMAP\\Sync\\Synchronizer",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
          "line": 343,
          "function": "sync",
          "class": "OCA\\Mail\\IMAP\\Sync\\Synchronizer",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
          "line": 221,
          "function": "runPartialSync",
          "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/lib/Service/Sync/SyncService.php",
          "line": 121,
          "function": "sync",
          "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/lib/Controller/MailboxesController.php",
          "line": 161,
          "function": "syncMailbox",
          "class": "OCA\\Mail\\Service\\Sync\\SyncService",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
          "line": 169,
          "function": "sync",
          "class": "OCA\\Mail\\Controller\\MailboxesController",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
          "line": 100,
          "function": "executeController",
          "class": "OC\\AppFramework\\Http\\Dispatcher",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
          "line": 152,
          "function": "dispatch",
          "class": "OC\\AppFramework\\Http\\Dispatcher",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/Route/Router.php",
          "line": 309,
          "function": "main",
          "class": "OC\\AppFramework\\App",
          "type": "::"
        },
        {
          "file": "/var/www/nextcloud/lib/base.php",
          "line": 1008,
          "function": "match",
          "class": "OC\\Route\\Router",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/index.php",
          "line": 37,
          "function": "handleRequest",
          "class": "OC",
          "type": "::"
        }
      ],
      "File": "/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php",
      "Line": 605
    },
    "CustomMessage": "Sync failed for 3:INBOX: Error connecting to mail server."
  },
  "userAgent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0",
  "version": "20.0.5.2"
}
{
  "reqId": "BSlwumkE79rbtvHY1VlJ",
  "level": 3,
  "time": "2021-01-24T09:40:57-06:00",
  "remoteAddr": "192.168.0.1",
  "user": "[USERNAME REMOVED]",
  "app": "mail",
  "method": "POST",
  "url": "/apps/mail/api/mailboxes/22/sync",
  "message": {
    "Exception": "OCA\\Mail\\Exception\\ServiceException",
    "Message": "Sync failed for 3:INBOX: Error connecting to mail server.",
    "Code": 0,
    "Trace": [
      {
        "file": "/var/www/nextcloud/apps/mail/lib/Service/Sync/SyncService.php",
        "line": 121,
        "function": "sync",
        "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/apps/mail/lib/Controller/MailboxesController.php",
        "line": 161,
        "function": "syncMailbox",
        "class": "OCA\\Mail\\Service\\Sync\\SyncService",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 169,
        "function": "sync",
        "class": "OCA\\Mail\\Controller\\MailboxesController",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
        "line": 100,
        "function": "executeController",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
        "line": 152,
        "function": "dispatch",
        "class": "OC\\AppFramework\\Http\\Dispatcher",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/lib/private/Route/Router.php",
        "line": 309,
        "function": "main",
        "class": "OC\\AppFramework\\App",
        "type": "::"
      },
      {
        "file": "/var/www/nextcloud/lib/base.php",
        "line": 1008,
        "function": "match",
        "class": "OC\\Route\\Router",
        "type": "->"
      },
      {
        "file": "/var/www/nextcloud/index.php",
        "line": 37,
        "function": "handleRequest",
        "class": "OC",
        "type": "::"
      }
    ],
    "File": "/var/www/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
    "Line": 238,
    "Previous": {
      "Exception": "Horde_Imap_Client_Exception",
      "Message": "Error connecting to mail server.",
      "Code": 11,
      "Trace": [
        {
          "file": "/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php",
          "line": 375,
          "function": "_connect",
          "class": "Horde_Imap_Client_Socket",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Base.php",
          "line": 838,
          "function": "_login",
          "class": "Horde_Imap_Client_Socket",
          "type": "->",
          "args": [
            "*** sensitive parameters replaced ***"
          ]
        },
        {
          "file": "/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Base.php",
          "line": 1598,
          "function": "login",
          "class": "Horde_Imap_Client_Base",
          "type": "->",
          "args": [
            "*** sensitive parameters replaced ***"
          ]
        },
        {
          "file": "/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Base.php",
          "line": 4038,
          "function": "status",
          "class": "Horde_Imap_Client_Base",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Base.php",
          "line": 3632,
          "function": "_syncStatus",
          "class": "Horde_Imap_Client_Base",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/lib/IMAP/Sync/Synchronizer.php",
          "line": 109,
          "function": "sync",
          "class": "Horde_Imap_Client_Base",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/lib/IMAP/Sync/Synchronizer.php",
          "line": 65,
          "function": "getNewMessageUids",
          "class": "OCA\\Mail\\IMAP\\Sync\\Synchronizer",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
          "line": 343,
          "function": "sync",
          "class": "OCA\\Mail\\IMAP\\Sync\\Synchronizer",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/lib/Service/Sync/ImapToDbSynchronizer.php",
          "line": 221,
          "function": "runPartialSync",
          "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/lib/Service/Sync/SyncService.php",
          "line": 121,
          "function": "sync",
          "class": "OCA\\Mail\\Service\\Sync\\ImapToDbSynchronizer",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/apps/mail/lib/Controller/MailboxesController.php",
          "line": 161,
          "function": "syncMailbox",
          "class": "OCA\\Mail\\Service\\Sync\\SyncService",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
          "line": 169,
          "function": "sync",
          "class": "OCA\\Mail\\Controller\\MailboxesController",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",
          "line": 100,
          "function": "executeController",
          "class": "OC\\AppFramework\\Http\\Dispatcher",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/AppFramework/App.php",
          "line": 152,
          "function": "dispatch",
          "class": "OC\\AppFramework\\Http\\Dispatcher",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/lib/private/Route/Router.php",
          "line": 309,
          "function": "main",
          "class": "OC\\AppFramework\\App",
          "type": "::"
        },
        {
          "file": "/var/www/nextcloud/lib/base.php",
          "line": 1008,
          "function": "match",
          "class": "OC\\Route\\Router",
          "type": "->"
        },
        {
          "file": "/var/www/nextcloud/index.php",
          "line": 37,
          "function": "handleRequest",
          "class": "OC",
          "type": "::"
        }
      ],
      "File": "/var/www/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php",
      "Line": 605
    },
    "CustomMessage": "Sync failed for 3:INBOX: Error connecting to mail server."
  },
  "userAgent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:84.0) Gecko/20100101 Firefox/84.0",
  "version": "20.0.5.2"
}

Does anyone have any idea why the application tries to get mail from 192.168.0.1 when it is configured for 127.0.0.1?

Forgive me, but this is at its peak of importance now. Our adoption of this solution has dwindled to one user now.

I´ve just the same problem. Posted it in the german section with no response. Would be greatfull for a hint.

Check this out!

1 Like