mail
mail copied to clipboard
Emails fail to send with "Could not send message"
Steps to reproduce
- Configure a user to use SMTP, no encryption (starttls and ssl/tls directly are unsupported on my current postfix config)
- Attempt to send an email to any source (can send to yourself as a test)
- Observe failure
Expected behavior
An email should be properly sent.
Actual behavior
No email is sent, and an error saying "Could not send message" appears.
Mail app version
3.2.4
Mailserver or service
Postfix
Operating system
Debian 12/bookworm
PHP engine version
PHP 8.2
Web server
Apache (supported)
Database
MariaDB
Additional info
Sending over (unencrypted) SMTP works completely fine on Thunderbird, so no reason it should fail on NC. I'm trying to get unencrypted set up first (passwords only traverse my local network currently, once I actually use this externally it'll need to be encrypted) and then get encrypted set up later (with proper SSL and all).
magically, this started working again. i'll keep posted here if anything changes
I'm reopening this since my testing with other accounts is making this happen again, and I'm not sure why. I'll keep experimenting
i have noticed two more things so far:
- despite me telling NC Mail not to use starttls, based on my postfix double-bounce logs, it's still trying to anyways a lot of the time.
- i have starttls working now (tested via thunderbird), NC still doesn't work properly (some accounts will work, some of the time, others just wont work at all) and if i try to set it to use starttls it just doesn't even let me save the connection
update: decided to wireshark my nextcloud instance. found out that, while there's normal smtp traffic whenever an email sends correctly, on the ones where it fails, it appears NC didn't even attempt to send anything. there's not a single SMTP packet. and, just to double-check, i looked if there was any traffic on 25/tcp on a fail, and nope, not even a SYN...
another update: upped 465 and 587. can use no TLS for one of my accounts succesfully, other one still doesn't work. can run no TLS over 587. using implicit TLS and STARTTLS both fail for all accounts to even save the profile still
so there appears to be IMAP issues here as well. i have proper IMAP with SSL/TLS and IMAP with STARTTLS set up. works fine in thunderbird. but yet again can't save an account with it on NC Mail...
i believe this has something to do with the smtp module NC uses. i went to the server-side settings (for sending, say, notifications) and couldn't send anything. however, my tests worked fine when changing to the sendmail option... granted, doesn't fix user emails, but still might help with debugging
Maybe this bug is has the same root cause as I describe in https://github.com/nextcloud/mail/issues/9230#issuecomment-1885614975.
Have you checked whether the default folders for "Sent mails" and "Trash" is correctly configured and point to existing folders?
In https://github.com/nextcloud/mail/issues/8629#issuecomment-1641013328 you write that Wireshark shows that Nextcloud does not even do anything. I encountered the same problem and after hours of trial-and-error I found out that the Mail App does not attempt to send an email (or delete an email) if the respective folder for sent/deleted mails is not properly configured.
@nagmat84 the issue appears to be fixed, at least for my case, in NC Hub 28. Can you confirm whether the same is occurring for you?
Test on FreeBSD 14.1p3, php 8.3, nextcloud 29.0.4, nextcloud-mail 3.7.7: Same problem.
Tested with recommendations from https://github.com/nextcloud/mail/issues/9230#issuecomment-1885614975, now I can at least respond via the Mail app.