Iām trying to setup my Nextcloud E-Mail server for E-Mail notifications. The problem is, after i setup all settings in Admin-Settings (Basic Settings) i get the error after clicking on send test E-Mail like this:
A problem occurred while sending the email. Please revise your settings. (Error: Expected response code 354 but got code "554", with message "554 5.5.1 Error: no valid recipients ")
I have tried all possible settings for my Mail-Server which is in my home network. I also updated the E-Mail address of my admin user to a vaild E-Mail. I tried to send an E-Mail to this address with my thunderbird setup towards my E-Mail server and it worked.
send mode is always SMTP
authentication methods: none, login
ports: 25 (no encryption), 465 (SSL, TLS), 587 (STARTTLS)
host: domainname, IP-Address
My E-Mail server is an Synology mail server, that does not require authentication on LAN connections.
My Nextcloud instance is running on a ubuntu 18.04 LTS inside a docker container. I am using the official image with the tag 16 (nextcloud:16), which is actually the apache image.
I am using the following environment variables to initialize the mail setup. All settings are applied after the container has been setup by the startup script:
The error message you posted says āno valid recipientā.
Can you check if the email-adress you are sending to is a real world adress you can receive emails on.
Nextcloud is sending the email to the email-adress you set for your account.
Also in your config āMAIL_FROM_ADDRESS=infoā should be āMAIL_FROM_ADDRESS=info@domain.deā
Can you send email directly from docker server (not from inside container)? If it is linux: something around: echo "content" | mail "test <test@mydomain.de>" -s "subject"
I think nextcloud already contacted the mail server successfully, then the mail server couldnāt find the email you inputted at settings > personal info, hence returning code 554.
thank you for your hints! After doing some āRTFMā here Nextcloud admin docs i found out that smtp-settings can be store in a seperate config.php file . Furthermore this config file then overwrites the settings in the main config.php. This was super confusing to me, because i desperately tried to change and add values in the main config.php without any effect. And something that confused me even more was that the settings i was updating via admin gui disappeared right after i reloaded the settings page.
After taking a look into the container i found that the ā¦/config/ subfolder contained not only one config.php, but also several other and a smtp.config.php file.
After opening it i found out, that all values are beeing set from the EVN variables defined during container installation like this:
After updating the values to my values i was successfully able to sent out a test e-mail .
Now, the interesting part is that iām thinking about moving the smtp.config.php outside of the container and then bind mounting it. This was i donāt have to configure the E-Mail settings via ENV variables during container installation - but i guess this is just a flavor of how to set up the email settings.