Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC 2822, 3.6.2 Error #8387

Closed
DanLeonelli opened this issue Feb 16, 2018 · 14 comments
Closed

RFC 2822, 3.6.2 Error #8387

DanLeonelli opened this issue Feb 16, 2018 · 14 comments
Milestone

Comments

@DanLeonelli
Copy link

Steps to reproduce

  1. Try to share any file
  2. Receive the error: Address in mailbox given [xxxx@] does not comply with RFC 2822, 3.6.2
  3. xxxx is the username

Expected behaviour

Success when sharing the file

Actual behaviour

Error message even though it's been successfully shared so it creates confusion

Server configuration

Operating system:

Web server:

Database:

PHP version:

Nextcloud version: (see Nextcloud admin page) 13.0.0
)

Updated from an older Nextcloud/ownCloud or fresh install: Updated

Where did you install Nextcloud from: Web

Signing status:

Signing status
Login as admin user into your Nextcloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results here.

No errors have been found.
screen shot 2018-02-16 at 12 01 48 am

List of activated apps:

App list
If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder

Nextcloud configuration:

Config report
If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your Nextcloud installation folder

or 

Insert your config.php content here. 
Make sure to remove all sensitive content such as passwords. (e.g. database password, passwordsalt, secret, smtp password, …)

Are you using external storage, if yes which one: local/smb/sftp/...

Are you using encryption: yes/no

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...

LDAP configuration (delete this part if not used)

LDAP config
With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your Nextcloud installation folder

Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap';


Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.

Client configuration

Browser:

Operating system:

Logs

Web server error log

Web server error log
Insert your webserver log here

Nextcloud log (data/nextcloud.log)

Nextcloud log
Insert your Nextcloud log here

Browser log

Browser log
Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...
@DanLeonelli
Copy link
Author

screen shot 2018-02-16 at 12 01 48 am

@DanLeonelli
Copy link
Author

Nobody?

@Schmuuu
Copy link

Schmuuu commented Feb 18, 2018

Could you please fill out the template? These information are requested for a good reason.

So for sharing you entered
admin@

as an email address to share a file/ folder?
Or was the email address really like
admin@domain.tld
?

@denunv
Copy link

denunv commented Feb 19, 2018

I changed the following lines to fix the email sending issue. I've added !defined('INTL_IDNA_VARIANT_UTS46') to the condition.

File: lib/private/Mail/Mailer.php
Line: 207
Code:
if (!function_exists('idn_to_ascii') || !defined('INTL_IDNA_VARIANT_UTS46') || strpos($email, '@') === false) {

File: lib/private/Mail/Message.php
Line: 68
Code:
if (!function_exists('idn_to_ascii') || !defined('INTL_IDNA_VARIANT_UTS46')) {

It also fixed #8409 for me. Got the idea from #239. 😉

@StealUrKill
Copy link

@denunv I don't know how you did that, but thanks, that fixed all my issues on a vps. Man I was getting fustrated. lol

@peter-parker
Copy link

peter-parker commented Mar 1, 2018

You can also fix the error by uploading these two files from previous OwnCloud version 9.1.7.
https://owncloud.org/download/

lib/private/Mail/Mailer.php
lib/private/Mail/Mail.php

@StealUrKill
Copy link

@peter-parker I assume next cloud and own cloud are similar or based off each other?

@JaredBoone
Copy link
Contributor

@LukasReschke @nickvergessen Please review my PR #9095 based on the change suggested by @denunv above.

@MorrisJobke MorrisJobke added this to the Nextcloud 14 milestone Apr 6, 2018
panovotn pushed a commit to panovotn/server that referenced this issue Apr 18, 2018
…_UTS46 is undefined.

Fixes nextcloud#8387.

Signed-off-by: Jared Boone <jared.boone@gmail.com>
@DJCrashdummy
Copy link

DJCrashdummy commented May 23, 2018

if i understand this correct, #9095 should fix this for NC13 (released via 13.0.2) and #9100 in master (for NC14+)...
but why do i still get this error after updating to 13.0.2.1 (build 2018-04-26)???

--> quick info about my setup: i haven't setup a mail-server for notifications, and use the IMAP-backend for user-management. - activity-notifications still work as ever.
btw: it seems (#6744) this issue already appeared in NC12 (at least with LDAP-backend).

@JaredBoone
Copy link
Contributor

@DJCrashdummy It would be helpful if you could give some more details. When does the error occur?What message appears in your log (including the destination email address)?

@DJCrashdummy
Copy link

DJCrashdummy commented Jun 4, 2018

@JaredBoone thanks for your reply!

this issue still occur as mentioned by the OP when sharing a folder with an other user.
the log only shows

Failed to send share by email: Address in mailbox given [SHORT NAME@localhost.localdomain] does not comply with RFC 2822, 3.6.2.

where SHORT NAME is "the short name of the software" (also containing a space) given in the defaults.php via the active theme.
--> after some testing i'm sure it hast to do with the theming, because without a theme, everything seems to work.
another thing i can confirm is, that getName() is displayed in the error-message (although getHTMLName() with the same name is available)... also using a &nbsp; wherever didn't change anything.

for the record: at both users personal page a valid email-address is entered. and also the activity-mails work for for all users as ever!

PS: with the theme active it gets even worse if you try to share by mail; you only get the message/info "Failed to send share by mail." instead and nothing gets shared.

@JaredBoone
Copy link
Contributor

@DJCrashdummy I suspect the error is caused by the "From:" field, not the "To:" field. On my server, that "From:" field is populated with "noreply@[my.company].com". Here are some questions that might help debug this: Have you tested the mailer configuration (Admin->Additional Settings->Test email settings)? Does your config.php file have a reasonable value (with no spaces) in the 'mail_from_address' field (eg 'noreply')? Do you have Nextcloud configured to send mail using php, smtp, or sendmail ('mail_smtpmode' in config.php)? What surrounding log statements do you see if you enable debug level logging ('loglevel' => 0 in config.php) and enable the mail_smtpdebug parameter in config.php? Since you mention that it seems to be related to the theme, are you using the official Nextcloud Theming App or a custom theme ('theme' in config.php)? Also, you may want to read the Troubleshooting section here: https://docs.nextcloud.com/server/13/admin_manual/configuration_server/email_configuration.html Hope this helps.

@DJCrashdummy
Copy link

@JaredBoone thanks for responding and hopefully getting this little nasty bug!

Since you mention that it seems to be related to the theme, are you using the official Nextcloud Theming App or a custom theme ('theme' in config.php)?

yes, i'm using a theme via 'theme' => 'theme-folder', in the config.php. - i haven't checked if this error also occurs with the theming-app.

I suspect the error is caused by the "From:" field, not the "To:" field.

i'm pretty sure about this, since all users still get mails from the nextcloud-server (e.g. activity-messages still work as ever in every setting), just the sharing makes problems.

On my server, that "From:" field is populated with "noreply@[my.company].com".

well... the addresser from my server without a theme look like Nextcloud <no-reply@cloud.domain.tld> and with an active theme (where the error occurs) SHORT NAME <no-reply@cloud.domain.tld> (but no idea if for the SHORT NAME the getName() or getHTMLName() sting is used).

Have you tested the mailer configuration (Admin->Additional Settings->Test email settings)?

interesting... again without a theme everything works as it should and the addresser is Nextcloud <Nextcloud@cloud.domain.tld>, but with the theme active no mail is sent and i just get an error:
A problem occurred while sending the email. Please revise your settings. (Error: Address in mailbox given [SHORT NAME@localhost.localdomain] does not comply with RFC 2822, 3.6.2.)

Does your config.php file have a reasonable value (with no spaces) in the 'mail_from_address' field (eg 'noreply')? Do you have Nextcloud configured to send mail using php, smtp, or sendmail ('mail_smtpmode' in config.php)?

no, i just use php for mails... so there aren't any mail-setting in the config.php.

What surrounding log statements do you see if you enable debug level logging ('loglevel' => 0 in config.php) and enable the mail_smtpdebug parameter in config.php?

unfortunately i guess nothing really useful... in case everything works i get 3 entries in the log:

Level App Message Time
Debug share Send share notification to user@domain.tld for share with ID 24 2018-06-07T06:00:00+0000
Debug core Sent mail to "Array ( [user@domain.tld] => ) " with subject "admin@domain.tld hat „Notes“ mit Dir geteilt" 2018-06-07T06:00:00+0000
Info admin_audit The folder "/Notes" with ID "17" has been shared to the user "user@domain.tld" with permissions "15" (Share ID: 24) 2018-06-07T06:00:00+0000

and with the error while sharing, just 2 of them are missing, but nothing else shows up:

Level App Message Time
Info admin_audit The folder "/Notes" with ID "17" has been shared to the user "user@domain.tld" with permissions "15" (Share ID: 25) 2018-06-07T06:10:00+0000

i tested some additional things and i'm pretty sure it has to do with the getName() and/or getHTMLName() and how they are used:

  • after removing the space from getName() everything seems to work.
  • getHTMLName() seems to have no relevance at all... in this case.
  • the activity-app seems to do it right, since its mails gets sent & received, even with the space (SHORT NAME) in both of them!
  • the sharing-app and even the mail-check seems to do something wrong, since they are getting in trouble with a space in getName(). --> no idea for now if there are other apps with this problem...!?

@JaredBoone
Copy link
Contributor

@DJCrashdummy I agree that you seem to have found a bug - I don't think the mailer should be using the "short name" field from a Theme as part of the email address at all and if it does then it should do something about whitespace. However I don't feel comfortable attempting to fix this myself. Since this GitHub Issue has already been closed against a Pull Request, I think you'll need to create a new Github Issue. I recommend filling out all of the details in the template, summarizing the information from our thread, pasting a link to this issue, and also providing steps to reproduce, for example:

  1. Create a theme with a getName() function that returns a string with whitespace
  2. Share a file with a user
  3. Observe RFC mail error in logs
    I know this seems like a lot of work, but that's how open source software gets better. Thanks for participating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants