Test and verify email settings adress failed

Hi

Have a synology/portainer/docker/Nextcloud installation 6 (27.1.3)
I have a problem to setup Email server in Basic settings.
Always running into error message:

A problem occurred while sending the email. Please revise your settings. (Error: Email could not be sent. Check your mail server log)

Tried with gmail and yahoo address. Both accounts 2-factor authorized.
Meaning created passwords and use it in the credential part.

Found in the docs that setting
‘mail_smtpdebug’ => true,
in config/config.php would give some details about the problem.

Logged in and set the parameter.
Verified also the credentials in there entered via GUI.

But the GUI does not show anything at all.

Any advice how to proceed would be appreciated.
Thank you

27.11.2023 added:
After digging in the docs found link:
[https://docs.nextcloud.com/server/21/admin_manual/configuration_server/logging_configuration.html?highlight=log%20file]
So I set also
“log_type” => “file”,
“logfile” => “nextcloud.log”,
Then I got error messages in the GUI.

Next step is: I have to figure out the meaning :stuck_out_tongue_winking_eye:

I’m having the same issue. I’ve done this a million times without error. I needed to recreate my nextcloud docker container and now I am mystified. I’m using a gmail account (tried non gmail and no go).

GMail needs to be enabled for remote clients in the Google account for security reason.
Please alo check, whether really SSL-encryption will be needed, or TLS is required.

The access of non-“certified” mail clients will be disabled by Google after several weeks or months and needs to be re-enabled manually in the Google account again.

2 Likes

I have no idea where to find that setting(s). Also, this didn’t work with a non-gmail account either.

Maybe this guide may help you:
https://mailmeteor.com/blog/gmail-smtp-settings

2 Likes

Did not help. I’m not trying to setup an email client. I’ve been using nextcloud since version 12 and never had this problem, why this issue started I have no idea.

Nextcloud sends it’s emails the same way an email client does.

A likely issue might be your docker container is missing some CA’s or the container is seeing the wrong IP address and can’t verify the STARTTLS cert. Add this to your config and verify:

"mail_smtpstreamoptions" => array(
    'ssl' => array(
        'allow_self_signed' => true,
        'verify_peer' => false,
        'verify_peer_name' => false
    )
),

Source:

https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/email_configuration.html#how-can-i-send-mail-using-self-signed-certificates-or-use-starttls-with-self-signed-certificates

I’m not using a self-signed cert.

It’s not your cert it’s ignoring errors on but the email servers. Give it a try before dismissing, For whatever reason it’s possible for your nextcloud instance to be unable to verify the email server’s cert and so the TLS handshake fails. I’ve done this with a Microsoft exchange server in the past

Hi

Finally try to understand the call stack:

[core] Debug: Symfony\Component\Mailer\Exception\TransportException: Expected response code “250” but got code “550”, with message “550 Request failed; Mailbox unavailable”. at <>

  1. /var/www/html/3rdparty/symfony/mailer/Transport/Smtp/SmtpTransport.php line 182
    Symfony\Component\Mailer\Transport\Smtp\SmtpTransport->assertResponseCode(“550 Request fai … n”, [250])
  2. /var/www/html/3rdparty/symfony/mailer/Transport/Smtp/SmtpTransport.php line 235
    Symfony\Component\Mailer\Transport\Smtp\SmtpTransport->executeCommand(“MAIL FROM:\r\n”, [250])
  3. /var/www/html/3rdparty/symfony/mailer/Transport/Smtp/SmtpTransport.php line 199
    Symfony\Component\Mailer\Transport\Smtp\SmtpTransport->doMailFromCommand(“MyEmailAddress”)
  4. /var/www/html/3rdparty/symfony/mailer/Transport/AbstractTransport.php line 72
    Symfony\Component\Mailer\Transport\Smtp\SmtpTransport->doSend(["Symfony\Compo … "])
  5. /var/www/html/3rdparty/symfony/mailer/Transport/Smtp/SmtpTransport.php line 136
    Symfony\Component\Mailer\Transport\AbstractTransport->send(["Symfony\Compo … "], ["Symfony\Compo … "])
  6. /var/www/html/3rdparty/symfony/mailer/Mailer.php line 45
    Symfony\Component\Mailer\Transport\Smtp\SmtpTransport->send([“Symfony\Component\Mime\Email”], null)
  7. /var/www/html/lib/private/Mail/Mailer.php line 216
    Symfony\Component\Mailer\Mailer->send([“Symfony\Component\Mime\Email”])
  8. /var/www/html/apps/settings/lib/Controller/MailSettingsController.php line 168
    OC\Mail\Mailer->send([“OC\Mail\Message”])
  9. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 230
    OCA\Settings\Controller\MailSettingsController->sendTestMail()
  10. /var/www/html/lib/private/AppFramework/Http/Dispatcher.php line 137
    OC\AppFramework\Http\Dispatcher->executeController(["OCA\Settings\ … "], “sendTestMail”)
  11. /var/www/html/lib/private/AppFramework/App.php line 183
    OC\AppFramework\Http\Dispatcher->dispatch(["OCA\Settings\ … "], “sendTestMail”)
  12. /var/www/html/lib/private/Route/Router.php line 315
    OC\AppFramework\App::main(“OCA\Settings\ … r”, “sendTestMail”, ["OC\AppFramewo … "], [“settings.MailSettings.sendTestMail”])
  13. /var/www/html/lib/base.php line 1068
    OC\Route\Router->match(“/settings/admin/mailtest”)
  14. /var/www/html/index.php line 36
    OC::handleRequest()

POST /settings/admin/mailtest
from MyWAN-IP by MyUserName at 2023-11-29T10:14:47+00:00

What mailbox is not available?
Can somebody give me some advise?
Thanks

https://support.google.com/a/answer/3221692?hl=en

550 Requested command failed because the user’s mailbox was unavailable, or the receiving server rejected the message because it was likely spam

Did you enter a valid Email Address for you Admin user under “Personal Settings” → “Email”?

1 Like

I checked Personal Settings. In there I used the yahoo email address.
In the Basic Settings Email Server settings I used the gmail address.
This happened because I tested with 2 mail addresses. After changing to gmail and recreation of a new app password everything works now. Thanks for your help.

2 Likes