mail icon indicating copy to clipboard operation
mail copied to clipboard

Sending an email is not possible if a sent mailbox is not configured

Open manu-p opened this issue 11 months ago • 38 comments

Steps to reproduce

  1. create a NC/Mail account hosted at OVH with automatic IMAP/SMTP settings
  2. create a new mail using this mail account
  3. send this new mail

Expected behavior

The mail is sent to the recipient(s)

Actual behavior

1st a popup on the right says the mail is sent, then after a few seconds another pop up says it could not be sent. The mail remains in the Outbox.

Mail app version

3.7.9

Nextcloud version

28.0.7 Enterprise

Mailserver or service

OVH

Operating system

Linux 5.15.0-122-generic x86_64

PHP engine version

PHP 8.2

Nextcloud memory caching

No response

Web server

None

Database

None

Additional info

The NC instance is hosted by IONOS as a "Managed Nextcloud". I can't upgrade NC nor any app.

When I create another mail account hosted for instance at hostinger, everything works fine.

I receive mails delivered to this OVH mail account in NC/Mail.

This is not a matter of OVH mail password.

When I configure the exact same OVH email account in thunderbird, everything works fine.

I'm not sure the following error is related to this bug:

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 230 in file '/var/www/html/apps/mail/lib/Controller/DraftsController.php' line 157

manu-p avatar Jan 06 '25 18:01 manu-p

I have the exact same issue, I'm still trying to figure a way to fix it, I would be interested if you find one

LH-Lawliet avatar Jan 07 '25 14:01 LH-Lawliet

Hi,

Just tried the exact same setting on another instance of Nextcloud Hub 9 30.0.4 with Mail app 4.1.1 and I experience the same failure.

I could add 'app.mail.smtp.timeout' => 30, in config.php but it did not solve the issue. Nor 'app.mail.transport' => 'php-mail'

I tried...

$ openssl s_time -connect ssl0.ovh.net:465
Collecting connection statistics for 30 seconds
**********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************

490 connections in 0.96s; 510.42 connections/user sec, bytes read 0
490 connections in 31 real seconds, 0 bytes read per connection


Now timing with session id reuse.
starting
**************************************************************************************************r*****************************************r********r******************************************************r********************r********r*****************************************r***r****************************r********************r***************r***r******************************************************************r**************r*********r********************************r**********************r********r****

512 connections in 0.96s; 533.33 connections/user sec, bytes read 0
512 connections in 31 real seconds, 0 bytes read per connection

and it does not look bad at all, does it?

manu-p avatar Jan 07 '25 15:01 manu-p

Another log I could isolate on the Hub 9 instance:

{"reqId":"lWHN9rczD7H1yO3omJW4","level":0,"time":"2025-01-07T15:07:03+00:00","remoteAddr":"my.ip.add.ress","user":"myUser","app":"no app in context","method":"POST","url":"/index.php/apps/mail/api/outbox/1","message":"OCA\\Mail\\Controller\\OutboxController::send uses the @NoAdminRequired annotation and should use the #[OCP\\AppFramework\\Http\\Attribute\\NoAdminRequired] attribute instead","userAgent":"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36","version":"30.0.4.1","data":[]}

manu-p avatar Jan 07 '25 15:01 manu-p

Hi @manu-p, Unfortunately, I cannot provide you with a solution. But I can tell you that everything is working normally for me with OVH (NC30.0.4, Mail 4.1.1). Have you looked at the smtp.log ?

StefInP avatar Jan 07 '25 18:01 StefInP

Hi @StefInP

These two NC instances are on shared hosting, one with IONOS (managed Nextcloud) and the other with hostinger, so I don't have access to the SMTP logs...

manu-p avatar Jan 07 '25 18:01 manu-p

BTW @StefInP what smtp.log file are you suggesting to look at?

manu-p avatar Jan 07 '25 18:01 manu-p

I did another try on a self-hosted (Ubuntu Server 22.04.5) with Nextcloud Hub 9 30.0.2 with Mail 4.1.1 and it is exactly the same...

At least, I should be able to find things on this server, provided someone give me clues to further investigate.

manu-p avatar Jan 07 '25 19:01 manu-p

@manu-p To view the smtp.log file, see the instructions on this page : https://github.com/nextcloud/mail/blob/main/doc/admin.md#logging In fact, this only applies to a self-hosted instance.

StefInP avatar Jan 07 '25 19:01 StefInP

Thanks for the link, I'd seen this page before saying "enable debug mode and set the log level to debug in your admin settings" but as you can read here, in the Enabling debug mode section: Do not enable this for production! This can create security problems and is only meant for debugging and development!

So I did not dare enabling debug mode, these instances being in production, and when I set the log level to debug, I don't see any horde_smtp.log aside nextcloud.log...

manu-p avatar Jan 07 '25 21:01 manu-p

Hi,

So I could switch debug on + log level to 0 (debug) on one of the instances I was talking about. Then I tried to re-send the mail still in the Outbox.

Result: no horde_smtp.log in data as mentioned in the documentation, and anywhere else.

manu-p avatar Jan 09 '25 09:01 manu-p

So to recap and hopefully motivate some responses, @LH-Lawliet and I are experiencing the same issue with the Mail app in NC, including the latest versions:

  • outgoing mails using the OVH SMTP server (ssl0.ovh.net, port 465, SMTP user/password existing and used for incoming mails which work fine) are not sent ;
  • any SMTP logs don't seem to exist/be accessible ;
  • when creating another mail account with another host in the Mail/NC app, outgoing mails are sent ;
  • when setting the OVH mail account in thunderbird with the same parameters, outgoing mail are sent .

What more can help diagnose this issue?

manu-p avatar Jan 09 '25 12:01 manu-p

And turning SMTP Security to None, SSL/TLS or STARTTLS does not change anything.

manu-p avatar Jan 09 '25 12:01 manu-p

I found this #10217

StefInP avatar Jan 09 '25 22:01 StefInP

Thanks @StefInP

So, do you confirm you bought an E-mail Pro from OVH (as mentioned as solution in https://github.com/nextcloud/mail/issues/10217#issuecomment-2390781760) so that would explain why it works on your side?

manu-p avatar Jan 10 '25 07:01 manu-p

Hi @manu-p, No, on my side, it's not a Pro mailbox. It's a mailbox that comes with the purchase of a domain name.

StefInP avatar Jan 10 '25 08:01 StefInP

OK, thanks @StefInP, so back to square one!

manu-p avatar Jan 10 '25 08:01 manu-p

Hi, did anyone get this to work? I have exactly the same problem. I can send Nextcloud system emails using the OVH SMTP servers, but not using the mail application, as described above. thanks a million.

OlivierB50 avatar Jan 29 '25 21:01 OlivierB50

Hi all,

Can anyone provide me with a horde_imap.log or a OVH test account? That way I can diagnose this.

Seb

SebastianKrupinski avatar Jan 29 '25 22:01 SebastianKrupinski

Hi, thanks for the response. It's still early morning here, but I'll set that up as soon as I'm in.

Thanks again.

OlivierB50 avatar Jan 30 '25 06:01 OlivierB50

Hi, @SebastianKrupinski I can give you an OVH mail account for testing, but not here I'm afraid.

Could you please explain me the way I could give you the credentials?

manu-p avatar Jan 30 '25 07:01 manu-p

@SebastianKrupinski are you this sebastiank on help.nextcloud.com?

In which case I could DM you the credentials...

manu-p avatar Jan 30 '25 07:01 manu-p

Hi,@SebastianKrupinski I did a search for the log file you wanted, but can't find it. Could you advice where to find it? I recently migrated to docker NC aio and have a litany of containers. thanks

OlivierB50 avatar Jan 30 '25 08:01 OlivierB50

@OlivierB50 so you're at the same point I was 3 weeks ago...

manu-p avatar Jan 30 '25 08:01 manu-p

@manu-p Yes indeed: I need to install NC onto a production environment soon and decided it was time to take it more serious. So I migrated my hosting provider to get the SSL certification and the Nextcloud All in one version. The mail app is the last part of a giant puzzle and learning curve of the past week.

OlivierB50 avatar Jan 30 '25 08:01 OlivierB50

I meant you don't have any horde_smtp.log (nor horde_imap.log but we're speaking about sending mails...) as it has already been discussed weeks ago.

manu-p avatar Jan 30 '25 08:01 manu-p

@manu-p my apologies; yes, no logs in any container or volume.

OlivierB50 avatar Jan 30 '25 09:01 OlivierB50

Hi @SebastianKrupinski , so I did some digging, ran some db updates and now have the following error from 2 different accounts:

[webdav] Debug: No public access to this resource., AppAPIAuth has not passed, No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured, No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured, No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured GET /remote.php/dav/ from 172.18.0.1 by -- at 30 janv. 2025, 17:13:39 [webdav] Debug: No public access to this resource., AppAPIAuth has not passed, No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured, No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured, No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured GET /remote.php/dav/ from 172.18.0.1 by -- at Jan 30, 2025, 5:16:59 PM

OlivierB50 avatar Jan 30 '25 16:01 OlivierB50

[webdav] Debug: No public access to this resource., AppAPIAuth has not passed, No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured, No 'Authorization: Bearer' header found. Either the client didn't send one, or the server is mis-configured, No 'Authorization: Basic' header found. Either the client didn't send one, or the server is misconfigured GET /remote.php/dav/

Hi @OlivierB50

This is unrelated to the SMTP login problem

SebastianKrupinski avatar Jan 30 '25 17:01 SebastianKrupinski

Could you please explain me the way I could give you the credentials?

Hi @manu-p

You can send me the information to [email protected].

SebastianKrupinski avatar Jan 30 '25 17:01 SebastianKrupinski

Done @SebastianKrupinski Thanks.

Roundcube link, in case you need it.

manu-p avatar Jan 30 '25 17:01 manu-p