Open gunzino opened 3 years ago
Sorry, why this one got closed? This is exactly the problem I have with the fresh install of Nextcloud: "A problem occurred while sending the email. Please revise your settings. (Error: Address in mailbox given [nextcloud@
Although this issue was closed for unknown reason, I think I have got rid of this problem with my installation using the following settings:
nextcloud:
host: "nextcloud.<my-domain>"
mail:
enabled: true
domain: "<my-domain>"
fromAddress: "nextcloud"
smtp:
host: "<my-smtp-relay>"
secure: "ssl"
port: 465
extraEnv:
- name: NEXTCLOUD_HOSTNAME
value: "nextcloud.<my-domain>"
- name: OVERWRITEHOST
value: "nextcloud.<my-domain>"
- name: OVERWRITEPROTOCOL
value: "https"
I was able to send the test email properly.
I've had this issue for ages. I upgraded to v23 and there's still the same issue.
I've the same problem right now. The additional @localhost.localdomain gives me the problem.
Same here. The issue persists.
After reading docs thoroughly, was able to fix the issue.
docker-compose config:
environment:
# Mail config
- MAIL_DOMAIN=mydomain.com
- SMTP_HOST=mail.mydomain.com
- SMTP_SECURE=ssl
- SMTP_PORT=465
- SMTP_AUTHTYPE=login
- SMTP_NAME=noreply@mydomain.com
- SMTP_PASSWORD=*******
- MAIL_FROM_ADDRESS=noreply
Yeah, the issue is now more about Nextcloud checking for invalid configuration before trying to send the email.
MAIL_FROM_ADDRESS=noreply
I see the misinterpretation of MAIL_FROM_ADDRESS: It suggest to type "mail@domain.tld ". Could it be?
+1 same issue here on Nextcloud 23.0.3.
In Settings -> Basic Settings, under Email Server when I click "Send email" to test and verify settings, it shows this error: Address in mailbox given [<user@mydomain.com>@localhost.localdomain] does not comply with RFC 2822, 3.6.2.)
where <user@mydomain.com>
is my username and domain name.
MAIL_FROM_ADDRESS=noreply
I see the misinterpretation of MAIL_FROM_ADDRESS: It suggest to type "mail@domain.tld ". Could it be?
Yep. In getDefaultEmailAddress()
clearly mail_from_address
is used only for the user part of e-mail. This is extremely confusing. IMO that variable should be deprecated and replaced with one with a clearer name
Also, I don't think it is a good idea to just fallback to localhost.localdomain
. If validating e-mail address failed, something is clearly wrong and an error should be produced.
Hi, please update to 24.0.9 or better 25.0.3 and report back if it fixes the issue. Thank you!
My goal is to add a label like e.g. 25-feedback to this ticket of an up-to-date major Nextcloud version where the bug could be reproduced. However this is not going to work without your help. So thanks for all your effort!
If you don't manage to reproduce the issue in time and the issue gets closed but you can reproduce the issue afterwards, feel free to create a new bug report with up-to-date information by following this link: https://github.com/nextcloud/server/issues/new?assignees=&labels=bug%2C0.+Needs+triage&template=BUG_REPORT.yml&title=%5BBug%5D%3A+
@szaimen The getDefaultEmailAddress()
function hasn't been changed in NC 25, so there is no way this has been solved.
This isn't really a bug, but an issue with:
MAIL_FROM_ADDRESS
should contain only the user part, not the whole address, as the name suggests,getDefaultEmailAddress()
should not fallback to a default value when validating failed, but raise an exception.In OP's case, environment variable contains the full address cloud@gunzo.eu
and overrides the valid mail_from_address
variable in config.php
. Removing the environment variable should be enough to fix the OP's problem, but the issue with communicating what went wrong still persists.
Can we split the two then, the first part should be an issue in nextcloud/docker, or use https://github.com/nextcloud/docker/issues/1187, and this issue should be renamed to handle the second part.
Can we split the two then, the first part should be an issue in nextcloud/docker, or use nextcloud/docker#1187, and this issue should be renamed to handle the second part.
sounds good!
How to use GitHub
Steps to reproduce
Expected behaviour
Mail should arrive
Actual behaviour
A problem occurred while sending the email. Please revise your settings. (Error: Address in mailbox given [cloud@gunzo.eu@localhost.localdomain] does not comply with RFC 2822, 3.6.2.)
Server configuration
Operating system: Docker
Web server: Apache
Database: MariaDB
PHP version: From docker image
Nextcloud version: 20.0.5
Updated from an older Nextcloud/ownCloud or fresh install: fresh install
Where did you install Nextcloud from: Docker
Config.php: 'mail_smtpmode' => 'smtp', 'mail_smtphost' => 'smtp.eu.mailgun.org', 'mail_smtpport' => '587', 'mail_smtpsecure' => 'tls', 'mail_smtpauth' => 1, 'mail_smtpauthtype' => 'LOGIN', 'mail_smtpname' => 'postmaster@gunzo.eu', 'mail_smtppassword' => 'xxxxx', 'mail_from_address' => 'cloud', 'mail_domain' => 'gunzo.eu',
docker-compose.xml: