Where does mail app save the settings?

Hello Team,

I’ve been trying to connect the mail app to our locally hosted mail server. I use a webclient and I can use Thuderbird to connect to our ClearOS mail server with no issues. But if I use the same settings in Nextcloud mail the settings save correctly but upon saving I can’t connect. Nextcloud Mail app always says I have an SMTP error?

I’ve checked ports and my Nextcloud can get to both port 143 and 25.
I’ve confirmed that the same settings work find on my Thunderbird.

Where can I find the settings I enter on my Nextcloud Server (what file and location) from the Mail App settings page? I don’t think the settings I’m entering are being saved and used when I open Mail.

I’ve looked in the Nextcloud logs and I can see the following errors:

[mail] Fatal: Updating account failed: Error connecting to SMTP server.
AND

{“reqId”:“XGm5Fnhr7PYPrOnnz4g46wAAAAM”,“level”:3,“time”:“2019-02-17T19:42:24+00:00”,“remoteAddr”:“192.168.1.1”,“user”:“27F9C913-0BE4-497E-BE67-992F307B8378”,“app”:“mail”,“method”:“GET”,“url”:"/nextcloud/index.php/apps/mail/api/accounts/3/folders",“message”:{“Exception”:“Horde_Imap_Client_Exception_ServerResponse”,“Message”:“IMAP error reported by server.”,“Code”:0,“Trace”:[{“file”:"/usr/share/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php",“line”:4309,“function”:"_getLine",“class”:“Horde_Imap_Client_Socket”,“type”:"->",“args”:[{“data”:{“modseqs”:[],“modseqs_nouid”:[]},“fetch”:{“class”:“Horde_Imap_Client_Fetch_Results”},“class”:“Horde_Imap_Client_Interaction_Pipeline”}]},{“file”:"/usr/share/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php",“line”:4237,“function”:"_sendCmdChunk",“class”:“Horde_Imap_Client_Socket”,“type”:"->",“args”:[{“data”:{“modseqs”:[],“modseqs_nouid”:[]},“fetch”:{“class”:“Horde_Imap_Client_Fetch_Results”},“class”:“Horde_Imap_Client_Interaction_Pipeline”},[{“debug”:[],“literalplus”:true,“literal8”:false,“on_error”:null,“on_success”:null,“pipeline”:{“data”:{“modseqs”:[],“modseqs_nouid”:[]},“fetch”:{“class”:“Horde_Imap_Client_Fetch_Results”},“class”:“Horde_Imap_Client_Interaction_Pipeline”},“response”:{“tag”:“86”,“responseCode”:null,“status”:3,“token”:{“class”:“Horde_Imap_Client_Tokenize”},“class”:“Horde_Imap_Client_Interaction_Server_Tagged”},“tag”:“86”,“class”:“Horde_Imap_Client_Interaction_Command”}]]},{“file”:"/usr/share/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php",“line”:1751,“function”:"_sendCmd",“class”:“Horde_Imap_Client_Socket”,“type”:"->",“args”:[{“data”:{“modseqs”:[],“modseqs_nouid”:[]},“fetch”:{“class”:“Horde_Imap_Client_Fetch_Results”},“class”:“Horde_Imap_Client_Interaction_Pipeline”}]},{“file”:"/usr/share/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Base.php",“line”:1728,“function”:"_status",“class”:“Horde_Imap_Client_Socket”,“type”:"->",“args”:[[{“class”:“Horde_Imap_Client_Mailbox”}],8205]},{“file”:"/usr/share/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Base.php",“line”:4033,“function”:“status”,“class”:“Horde_Imap_Client_Base”,“type”:"->",“args”:[[“Public folders/Swas Labs Folders/Vendors & Suppliers /Petronor Haricana “],8205]},{“file”:”/usr/share/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Base.php”,“line”:3585,“function”:"_syncStatus",“class”:“Horde_Imap_Client_Base”,“type”:"->",“args”:[“Public folders/Swas Labs Folders/Vendors & Suppliers /Petronor Haricana “]},{“file”:”/usr/share/nextcloud/apps/mail/lib/IMAP/FolderMapper.php”,“line”:69,“function”:“getSyncToken”,“class”:“Horde_Imap_Client_Base”,“type”:"->",“args”:[“Public folders/Swas Labs Folders/Vendors & Suppliers /Petronor Haricana “]},{“file”:”/usr/share/nextcloud/apps/mail/lib/Service/MailManager.php”,“line”:87,“function”:“getFolders”,“class”:“OCA\Mail\IMAP\FolderMapper”,“type”:"->",“args”:[{“class”:“OCA\Mail\Account”},{“cacheFields”:{“1”:“HICstruct”,“8”:“HIChdrs”,“9”:“HICenv”,“10”:“HICflags”,“11”:“HICdate”,“12”:“HICsize”},“changed”:true,“statuscache”:true,“class”:“Horde_Imap_Client_Socket”}]},{“file”:"/usr/share/nextcloud/apps/mail/lib/Controller/FoldersController.php",“line”:74,“function”:“getFolders”,“class”:“OCA\Mail\Service\MailManager”,“type”:"->",“args”:[{“class”:“OCA\Mail\Account”}]},{“file”:"/usr/share/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",“line”:166,“function”:“index”,“class”:“OCA\Mail\Controller\FoldersController”,“type”:"->",“args”:[3]},{“file”:"/usr/share/nextcloud/lib/private/AppFramework/Http/Dispatcher.php",“line”:99,“function”:“executeController”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:"->",“args”:[{“class”:“OCA\Mail\Controller\FoldersController”},“index”]},{“file”:"/usr/share/nextcloud/lib/private/AppFramework/App.php",“line”:118,“function”:“dispatch”,“class”:“OC\AppFramework\Http\Dispatcher”,“type”:"->",“args”:[{“class”:“OCA\Mail\Controller\FoldersController”},“index”]},{“file”:"/usr/share/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php",“line”:47,“function”:“main”,“class”:“OC\AppFramework\App”,“type”:"::",“args”:[“OCA\Mail\Controller\FoldersController”,“index”,{“class”:“OC\AppFramework\DependencyInjection\DIContainer”},{“accountId”:“3”,"_route":“mail.folders.index”}]},{“function”:"__invoke",“class”:“OC\AppFramework\Routing\RouteActionHandler”,“type”:"->",“args”:[{“accountId”:“3”,"_route":“mail.folders.index”}]},{“file”:"/usr/share/nextcloud/lib/private/Route/Router.php",“line”:297,“function”:“call_user_func”,“args”:[{“class”:“OC\AppFramework\Routing\RouteActionHandler”},{“accountId”:“3”,"_route":“mail.folders.index”}]},{“file”:"/usr/share/nextcloud/lib/base.php",“line”:987,“function”:“match”,“class”:“OC\Route\Router”,“type”:"->",“args”:["/apps/mail/api/accounts/3/folders"]},{“file”:"/usr/share/nextcloud/index.php",“line”:42,“function”:“handleRequest”,“class”:“OC”,“type”:"::",“args”:[]}],“File”:"/usr/share/nextcloud/apps/mail/vendor/pear-pear.horde.org/Horde_Imap_Client/Horde/Imap/Client/Socket.php",“Line”:4597,“CustomMessage”:"–"},“userAgent”:“Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36”,“version”:“15.0.4.0”,“id”:“5c69bb35b8d60”}

Hello Forum,

I’m doing some more digging and I see reference from this post that I could update a file like so:

What file and where does this file live where I could add the following:

‘app.mail.accounts.default’ => [
‘email’ => ‘%USERID%@yourdomain.at’’,
‘imapHost’ => ‘imap.yourserver.com’,
‘imapPort’ => 993,
‘imapUser’ => ‘%USERID%@yourdomain.at’,
‘imapSslMode’ => ‘ssl’,
‘smtpHost’ => ‘smtp.yourserver.com’,
‘smtpPort’ => 486,
‘smtpUser’ => ‘%USERID%@yourdomain.at’’,
‘smtpSslMode’ => ‘none’, ],

Thank you,

See https://github.com/nextcloud/mail/blob/master/doc/admin.md

Hello @ChristophWurst and thank you for this reply. I apologize for the delay in responding to you.

I’ve read that linke already…but I don’t know what config.php it’s referring too? Can you tell me where this config.php file lives please and perhaps where in that file I add in the mail details?

Also…I don’t understand why the Nextcloud Mail App doesn’t work for us inputting the details on the GUI for our mail server. Rainloop (also a Nextcloud App for mail), Roundcube, Thunderbird all work pointing to our ClearOS (Zarafa) mail server with no issues. I’ve never been able to get this Nextcloud Mail app to work. I’ve asked a friend of mine who also uses Nextcloud and he also has never been able to get this Nextcloud Mail app to work? Is there a trick or something we are all missing?

Any advice or pointers you can provide for me would be greatly appreciated.

Thank you.

You can find it documented here: https://docs.nextcloud.com/server/stable/admin_manual/configuration_server/config_sample_php_parameters.html#configuration-parameters