I am experiencing an issue with the Mail app on Nextcloud version 31.0.6 when integrating it with our MDaemon mail server (version currently unknown, but I have access to the server if needed).
The issue is the following:
I can successfully connect multiple user accounts via IMAP/SMTP.
All users are able to receive incoming mail without problems.
However, only one user at a time is able to send emails through the Nextcloud Mail interface.
When I remove the account of the user who can currently send mail, another user (who previously could not send) suddenly gains the ability to send messages.
Sending messages directly from the MDaemon web interface works fine for all users, including sending to internal and external addresses (e.g., Gmail).
This suggests that something in the integration between Nextcloud Mail and MDaemon is preventing multiple users from sending emails simultaneously.
Could you please assist me in identifying the cause of this issue and suggest a solution?
Your rules on the MDaemon mail server are a kind of complex and/or restrictive.
You might check their logs while sending or check if your SMTP configuration follows their authentication and restriction rules here:
As per your recommendation, I have checked the mail server settings, and there are no restrictions on sending. I apologize for my limited English — I am using a translator.
I am able to receive emails without issues from both Gmail and internal MDaemon accounts.
However, I am not able to send emails in any direction — not even between users within MDaemon.
As a test, I tried sending an email using the following command:
Thanks for the infos, and I am not part of the Nextcloud Support Team Just a random Nextcloud guy, and I also use the translator a lot of times, as I speak Portuguese and german; no worries.
Which user is configured in your basic settings as an SMTP user? And could you test the SMTP settings successfully?
In the “Basic settings” of Nextcloud, I configured the SMTP user as: user@domen.com
However, when I try to test the SMTP configuration from the Nextcloud interface (by clicking “Send test email”), it returns a 400 error.
So unfortunately, I cannot verify the connection through the web interface.
Let me know if I should provide any logs or more details.
Hi,
Thanks for your message. I’ve already fixed the issue you mentioned, but unfortunately messages still aren’t being sent for the user via the browser.
Let me know if there’s anything else I should check or try.
I tested the SMTP connection using swaks and openssl s_client from the server CLI.
Authentication is successful, TLS handshake is OK, and sending emails via command line works perfectly.
The problem only appears when sending email via the Nextcloud web interface.
Login and receiving mail (IMAP) are working fine.
The issue:
I have 5 Nextcloud users connected to the same mail server.
Only 4 users can send email at any given time.
When I add a new user, that user works fine.
But then, one of the previously working users can no longer send (web interface shows “Message could not be sent”).
The failure switches — it’s like there is a cap on active sending users.
It seems not SMTP-related, because the mail server logs show successful login and acceptance when tested outside of Nextcloud.
Mail configuration (example):
pgsql
КопироватьРедактировать
Mail server: mail.domain.com
Port: 587
Encryption: STARTTLS
Authentication method: LOGIN
From address: user@domain.com
Login credentials: Same as user login (SMTP auth works)
Could this be related to:
Some internal session or cache limit in Nextcloud?
Mail app bug when multiple users are active?
Or something else?
Any insight would help! I can provide logs or configs if needed.
Yes, MDaemon uses a unified licensing model that covers the number of mailboxes. SMTP services are included as part of the server functionality, so no separate license is required for SMTP. Our current license is sufficient for our needs.
Regarding the 'Could not send message' error in Nextcloud:
The mail server logs (Postfix/MDaemon) show no relevant entries at the time of the error — it seems no connection is made when the error occurs.
The Nextcloud log contains generic PHP warnings related to socket connection issues (timeouts or failed SSL handshakes).
As for the horde_smtp.log file — it does not exist on the system, despite having 'app.mail.smtplog.enabled' => true and 'mail_smtpdebug' => 'true' configured in config.php.
Please advise if there are any further steps to enable this logging or alternative ways to trace mail issues in more detail.
Are these messages related to the mail app, or do they pop up at the same time you’re users are trying to send email, then they may have something to with it. Could still be a bug in Nextcloud or in the mail app.
I’ve never tried that myself, so I can’t add anything to what is in the documentation I linked, which unfortunately does not seem to be very comprehensive.
The Nextcloud log contains generic PHP warnings related to socket connection issues (timeouts or failed SSL handshakes).
Please post these entries if you want us to try to help you.
As for the horde_smtp.log file — it does not
exist on the system, despite having 'app.mail.smtplog.enabled' => true and 'mail_smtpdebug' => 'true' configured in config.php.
[/quote]
Neither of those are the logging parameters for the Mail app. Please recheck the linked docs.
I’m sorry, we forgot to update our admin documentation. Newer version of the mail app use one logfile per email account and not merge them all together.
In your data folder, there you should find our logs starting with “mail”, followed by the userid, the account id and (imap|smtp|sieve).
On the server, I found the data folder at the following path:
kotlin
КопироватьРедактировать
/var/www/nextcloud/data
Inside this folder, I see user account folders, but within those, there is no additional data folder as mentioned in your response.
Could you please clarify exactly where the horde_imap.log and horde_smtp.log files are saved? Are they supposed to be inside /var/www/nextcloud/data or somewhere else?
I reported earlier that sending emails via the Mail app UI was failing for some accounts, even though sending via other clients (like Thunderbird or swaks) worked fine. Additionally, deleting messages from the Sent or Trash folders showed the error:
No trash mailbox configured
After investigating further, I found that the problem was due to the Mail app not correctly mapping the IMAP special folders (Sent, Trash, Drafts, etc.) for some accounts. Interestingly, it sometimes detects them properly on its own, and sometimes it leaves them unassigned.
I manually fixed this by going to:
Account settings → Default folders → and assigning the correct folders for each function (Sent, Trash, Drafts, etc.)
After configuring the folder mapping, sending emails and deleting messages started working as expected.
One note: I checked the Nextcloud logs while reproducing the issue, and there were no error messages reported — everything looked successful in the logs, even though it wasn’t actually working.
So the issue is resolved on my side now, but it would be great if the folder mapping detection could be made more consistent, or at least notify the user when the folders are not properly configured.