Nextcloud AIO vs mailcow Snappymail works, mailapp fails (2)

Hi,

In this topic I got the mail app working for the first time (Nextcloud mail docker dovecot).
3 month ago it stopped working and now I partially got it working again, here’s my problem description:

I am running Nextcloud AIO and Mailcow, mailcow is up to date, Nextcloud is still on 28 (awaiting the normal upgrade to 29).

Both are running in their own docker network, so I had to give Mailcow double network adresses for the services used by Nextcloud mail, Dovecot and Postfix and allow the Nextcloud network to connect to the services. The adresses got lost 2 month ago (I suspect) In a container upgrade since the last time and this is how I got it working again, at least somehow.

I am able to connect Snappymail over IMAP to dovecot and I am also able to connect to postfix, shown in the logging of Postfix.

I am able to connect Nextcloud Mail over IMAP to Dovecot, but Postfix only mentions chunking, Nextcloud log only mentions “Server requires Authentication”.

Using the mail app horde Imap client exceptions are logged as well as allowed memory size exhausted loggings.

When enabling debugging (debug on and loglevel 0 in config.php) no extra logs are created, aside the nextcloud.log, so no trail can be found of why the mail app is failing to authenticate.

In Snappy mail under domains I configured exactly the same settings (servername, port authentication protocol) as I did in the mailapp regarding IMAP and SMTP.

How to troubleshoot this, or how to reset the mailapp fully (remove app and settings and reinstall / reconfigure)?

This is what I see in the logs:

I think all mail-app related database items need to be removed, snappymail is very snappy at the same time.

So how to troubleshoot this, or where can I get help (I tried posting the same question one month ago, no one dared to give a hint how to get this solved.

Also, I just saw that you use the php-mail transport 1. Perhaps you could try to remove this setting temporarily and see if that improves the situation. Is there a specific reason for overwriting the transport setting?

This looks a bit like the credentials for SMTP are not correct. Have a look at your account settings of the mail account inside the Mail app and double check port, encryption and enter the password again.

1 Like

Hi,

I did notice something strange in the configs from the mailapps, thanks for pointing me in that direction!

But…
Snappy mail is using the external server name on the internal ssl/tls port (4065).
Mail only authenticates using the docker hostname using no security.
If I configure it the same as snappymail it fails to my surprise (they are running on the same docker container I assume or am I wrong assuming that???).

I don’t know where you found I am using PHP-mail (php in the screendump?), I can’t find it in /docker/volumes/nextcloud_aio_nextcloud/_data/config/config.php or am I looking at the wrong place?

As I asked it here before, the screendump was a little older. I allready disabled PHP in the email.
These are the failures when trying to send an email now:

Error mail
Horde_Mime_Exception Server requires authentication.
“26 jun 2024 22:50:43”
Error mail
Exception OCA\Mail\Controller\DraftsController::update(): Argument #2 ($accountId) must be of type int, null given, called in /var/www/html/lib/private/AppFramework/Http/Dispatcher.php on line 232 in file ‘/var/www/html/custom_apps/mail/lib/Controller/DraftsController.php’ line 157
“26 jun 2024 22:50:08”
Error mail
Exception OCA\Mail\Controller\DraftsController::update(): Argument #2 ($accountId) must be of type int, null given, called in /var/www/html/lib/private/AppFramework/Http/Dispatcher.php on line 232 in file ‘/var/www/html/custom_apps/mail/lib/Controller/DraftsController.php’ line 157
“26 jun 2024 22:50:08”

Pity how small the userbase must be, looking at only a few tips to sort this out on my questions.

maybe it’s worth a try asking your question again on the mailcow-forum?
I can imagine you would find more users running nextcloud next to mailcow than vice versa.

And if you’d do so it would be nice if you would link your thread from there to here as well so that interested users from here could see how this thing would go along on the other side… :wink:

Hi Jimmy,

Two mail clients exist in Nextcloud. One of them is working, the other is not.
I need to know if they operate in the same container (not to be answered by mailcow) and if they do, why one of them is working (again this is more a Nextcloud issue then mailcow imho).

To me this seems the right place to ask, but I may be wrong, please explain then.

1 Like

for me it still looks like a config error (in your mailcow). that’s why I suggested that.
As it’s only a suggestion there’s nothing more you need to do, of course. :wink:

So again two mail clients behave differently against the same mail platform, how can that be caused by the mail platform? How are these client different in config or placement, that this difference could occur?

Puzzling that no one is able to explain this on the Nextcloud side.
Is there knowledge about both apps, who is able to explain more about this?

easy example: one of which is more lean with the setting while the other one might be more strict. any maybe your settings would fit the lean model while it would be too lean for the stricter one.

again: just guessing. :wink:

I´t is truly nice you answer and I’m sure you have thorough knowledge of the other parts of Nextcloud, but here I’m doubting that.

Just guessing :wink:

So who is willing to tell me how to troubleshoot on the mailclient side. Debugging does not create the described logging and again: two clients on the same platform (are these on the same platform, one almost builtin the other as app installed, running in the same location, or am I missing completely the architecture), different behavior, where is documentation?

Slam me with what I should have read before posting a question?

That’s totally ok. I don’t mind :slight_smile:

As I have read there’s an extra routine (on mailcows side) to install nextcloud next to mailcow. How did you install your setup?
Are you aware of the apparently special settings that seem to be neccessary to setup mc and nc side-by-side?

Hi,

I started out with the integrated variant but soon discovered this was more conflicting as no one could support it, as it was custom in the eyes of a Nextcloud enthousiast, as also in the eyes of Mailcow mods. A few weeks ago Mailcow announced they will stop with the nextcloud script, so I made the right guess earlier.

Also and still I am puzzeld seeing that 2 apps with the same settings in Nextcloud are behaving differently. That should not point to where they are communicating with, but to the failing app or the succeeding app.
Something is different between the two mail clients, but I cannot find out what, nor troubleshoot if I don´t know how.

Pity no one here knows about either the mailapp nor the Nextcloud Snappymail implementation.

This also gives me the distinct impression Outlook is still the standard (so no reason to support it well from a business point of view) and that is really pityfull, because in business we especially should be moving away from the big companies.

This is also fascinating:


Account updated suggests it works, but not in this case…
[mail] Error: Server requires authentication.
POST /apps/mail/api/outbox/78
from 192.168.0.124 by … at 14 jul 2024 15:57:34

So there is a bug in the mail app. It does not authenticate at all.
It doesn´t matter what you fill in in the user or password, it always passes. Wrong ports or targets get detected but it does not authenticate.
When sending it does check and then it fails (still no reason for that), so one horde taken, a lot to go…

feel free to file a bug report after you checked for existing ones about that problem.

remember that you’re on the HOMEUSER forum. Business-clients should address to Nextcloud Inc. to get support/help

  1. Go to SnappyMail admin and enable debug.
  2. Send a message using snappymail.
  3. Disable debug
  4. Open the log that is somewhere in the /data/app_snappymail/... folder

Somewhere in the log you will find how SnappyMail sends the message.
Maybe that helps.

1 Like

@JimmyKater
I will file a report, allready posted one (other topic), will post a new one about this topic when that one is finished.

I am on a user forum and I am (hopefully) free to look an app from a business point of view (as I am very curious on the business implementations, what has added value and what does not). I know not all apps are developed for business (allthough I learned here apps can grow in to a business need, so it is a thin line).

This is what snappymail logs:

[2024-09-23 13:31:35.980][2b445b87] SMTP[INFO]: Start connection to “ssl://mailserver.FQDN.nl:4065”
[2024-09-23 13:31:36.010][2b445b87] SMTP[INFO]: Connect (success)
[2024-09-23 13:31:36.010][2b445b87] SMTP[DEBUG]: 0.030144929885864 (raw connection)
[2024-09-23 13:31:36.052][2b445b87] SMTP[INFO]: < 220 mailserver.FQDN.nl ESMTP Postcow\r\n
[2024-09-23 13:31:36.053][2b445b87] SMTP[INFO]: > EHLO nextcloud.FQDN.nl\r\n
[2024-09-23 13:31:36.053][2b445b87] SMTP[INFO]: < 250-mailserver.FQDN.nl\r\n
[2024-09-23 13:31:36.054][2b445b87] SMTP[INFO]: < 250-PIPELINING\r\n
[2024-09-23 13:31:36.054][2b445b87] SMTP[INFO]: < 250-SIZE 104857600\r\n
[2024-09-23 13:31:36.054][2b445b87] SMTP[INFO]: < 250-ETRN\r\n
[2024-09-23 13:31:36.054][2b445b87] SMTP[INFO]: < 250-AUTH PLAIN LOGIN\r\n
[2024-09-23 13:31:36.054][2b445b87] SMTP[INFO]: < 250-AUTH=PLAIN LOGIN\r\n
[2024-09-23 13:31:36.054][2b445b87] SMTP[INFO]: < 250-ENHANCEDSTATUSCODES\r\n
[2024-09-23 13:31:36.054][2b445b87] SMTP[INFO]: < 250-8BITMIME\r\n
[2024-09-23 13:31:36.054][2b445b87] SMTP[INFO]: < 250 DSN\r\n
[2024-09-23 13:31:36.055][2b445b87] PLUGIN[INFO]: Hook: smtp.before-login
[2024-09-23 13:31:36.055][2b445b87] SMTP[INFO]: > AUTH PLAIN\r\n
[2024-09-23 13:31:36.056][2b445b87] SMTP[INFO]: < 334 \r\n
[2024-09-23 13:31:36.057][2b445b87] SMTP[INFO]: > *******\r\n
[2024-09-23 13:31:36.072][2b445b87] SMTP[INFO]: < 235 2.7.0 Authentication successful\r\n
[2024-09-23 13:31:36.072][2b445b87] SMTP[INFO]: > MAIL FROM:user@FQDN.nl\r\n
[2024-09-23 13:31:36.090][2b445b87] SMTP[INFO]: < 250 2.1.0 Ok\r\n
[2024-09-23 13:31:36.090][2b445b87] SMTP[INFO]: > RCPT TO:testuser@outlook.com\r\n
[2024-09-23 13:31:36.214][2b445b87] SMTP[INFO]: < 250 2.1.5 Ok\r\n
[2024-09-23 13:31:36.215][2b445b87] SMTP[INFO]: > DATA\r\n
[2024-09-23 13:31:36.221][2b445b87] SMTP[INFO]: < 354 End data with .\r\n
[2024-09-23 13:31:36.221][2b445b87] SMTP[INFO]: Message data.
[2024-09-23 13:31:36.222][2b445b87] SMTP[INFO]: > .\r\n
[2024-09-23 13:31:36.572][2b445b87] SMTP[INFO]: < 250 2.0.0 Ok: queued as 344261EA943E\r\n
[2024-09-23 13:31:36.573][2b445b87] SMTP[INFO]: > QUIT\r\n
[2024-09-23 13:31:36.577][2b445b87] SMTP[INFO]: < 221 2.0.0 Bye\r\n
[2024-09-23 13:31:36.578][2b445b87] SMTP[INFO]: Disconnected from “ssl://mailserver.FQDN.nl:4065” (success)

If I use the same settings in mail, mail will fail.