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-error when sharing after upgrading from NC 12.0.2 to NC 12.0.3 #6744

Closed
mayerthomas opened this issue Oct 3, 2017 · 17 comments
Closed

Comments

@mayerthomas
Copy link

mayerthomas commented Oct 3, 2017

Steps to reproduce

  1. Update from 12.0.2 to 12.0.3
  2. Share a folder with a ldap-user
  3. Error/Hint on the top of the nextcloud-site:

Address in mailbox given [Nextcloud Company Name@localhost.localdomain] does not comply with RFC 2822, 3.6.2.

Expected behaviour

The folder should be shared without the hint. All LDAP-Users in my installation have valid mail-adresses in the ldap-field “mail”. But that never was important since i use the userPrincipalName as internal username.

Actual behaviour

This error should - as in version 12.0.2 - not appear. The folder will be shared anyway, but to see the user in the list of people with whom the folder is shared, you have to select another folder first and then select the affected folder again.
Maybe related to #951?

Server configuration

Operating system: Debian 9

Web server: Apache 2

Database: MariaDB

PHP version: 7.0

Nextcloud version: 12.0.3

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

Where did you install Nextcloud from: zip from project-website

Signing status:

Signing status No errors have been found.

List of activated apps:

App list Enabled: - activity: 2.5.2 - admin_audit: 1.2.0 - bruteforcesettings: 1.0.2 - dav: 1.3.0 - federatedfilesharing: 1.2.0 - federation: 1.2.0 - files: 1.7.2 - files_pdfviewer: 1.1.1 - files_sharing: 1.4.0 - files_texteditor: 2.4.1 - files_trashbin: 1.2.0 - files_versions: 1.5.0 - files_videoplayer: 1.1.0 - firstrunwizard: 2.1 - gallery: 17.0.0 - logreader: 2.0.0 - lookup_server_connector: 1.0.0 - nextcloud_announcements: 1.1 - notifications: 2.0.0 - oauth2: 1.0.5 - password_policy: 1.2.2 - provisioning_api: 1.2.0 - serverinfo: 1.2.0 - sharebymail: 1.2.0 - survey_client: 1.0.0 - theming: 1.3.0 - twofactor_backupcodes: 1.1.1 - updatenotification: 1.2.0 - user_ldap: 1.2.1 - workflowengine: 1.2.0 Disabled: - comments - encryption - files_external - systemtags - user_external

Nextcloud configuration:

Config report I switched back to 12.0.2-Snapshot: { "system": { "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "nextcloud.rsarnstorf.de", "www.nextcloud.rsarnstorf.de" ], "datadirectory": "\/srv\/nextcloud-data", "overwrite.cli.url": "https:\/\/nextcloud.rsarnstorf.de", "dbtype": "mysql", "version": "12.0.2.0", "dbname": "nextcloud", "dbhost": "localhost", "dbport": "", "dbtableprefix": "oc_", "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "htaccess.RewriteBase": "\/", "ldapUserCleanupInterval": 15, "memcache.local": "\\OC\\Memcache\\APCu", "share_folder": "\/Mit mir geteilt", "ldapIgnoreNamingRules": false, "ldapProviderFactory": "\\OCA\\User_LDAP\\LDAPProviderFactory", "loglevel": 2, "maintenance": false, "instanceid": "ocmskkpv9em4" } }

Are you using external storage, if yes which one: no

Are you using encryption: no

Are you using an external user-backend, if yes which one: LDAP

LDAP configuration (delete this part if not used)

LDAP config

+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Configuration | |
+-------------------------------+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| hasMemberOfFilterSupport | 1 |
| hasPagedResultSupport | |
| homeFolderNamingRule | |
| lastJpegPhotoLookup | 0 |
| ldapAgentName | CN=Administrator,CN=Users,DC=rsa-sn,DC=intra |
| ldapAgentPassword | *** |
| ldapAttributesForGroupSearch | |
| ldapAttributesForUserSearch | |
| ldapBackupHost | |
| ldapBackupPort | |
| ldapBase | OU=School,DC=rsa-sn,DC=intra |
| ldapBaseGroups | OU=Groups,OU=School,DC=rsa-sn,DC=intra |
| ldapBaseUsers | OU=Users,OU=School,DC=rsa-sn,DC=intra |
| ldapCacheTTL | 600 |
| ldapConfigurationActive | 1 |
| ldapDefaultPPolicyDN | |
| ldapDynamicGroupMemberURL | |
| ldapEmailAttribute | mail |
| ldapExperiencedAdmin | 1 |
| ldapExpertUUIDGroupAttr | |
| ldapExpertUUIDUserAttr | |
| ldapExpertUsernameAttr | userPrincipalName |
| ldapGidNumber | gidNumber |
| ldapGroupDisplayName | cn |
| ldapGroupFilter | (&(|(objectclass=group))(|(cn=5a)(cn=5b)(cn=5c)(cn=5d)(cn=5e)(cn=5f)(cn=6a)(cn=6b)(cn=6c)(cn=6d)(cn=6e)(cn=6f)(cn=7a)(cn=7b)(cn=7c)(cn=7d)(cn=7e)(cn=7f)(cn=8a)(cn=8b)(cn=8c)(cn=8d)(cn=8e)(cn=8f)(cn=9a)(cn=9b)(cn=9c)(cn=9d)(cn=9e)(cn=9f)(cn=10a)(cn=10b)(cn=10c)(cn=10d)(cn=10e)(cn=10f)(cn=lehrer)(cn=schueler)(cn=schulleitung)(cn=erweiterte-schulleitung))) |
| ldapGroupFilterGroups | 5a;5b;5c;5d;5e;5f;6a;6b;6c;6d;6e;6f;7a;7b;7c;7d;7e;7f;8a;8b;8c;8d;8e;8f;9a;9b;9c;9d;9e;9f;10a;10b;10c;10d;10e;10f;lehrer;schueler;schulleitung;erweiterte-schulleitung |
| ldapGroupFilterMode | 0 |
| ldapGroupFilterObjectclass | group |
| ldapGroupMemberAssocAttr | member |
| ldapHost | 10.1.1.5 |
| ldapIgnoreNamingRules | |
| ldapLoginFilter | (&(objectclass=)(samaccountname=%uid)) |
| ldapLoginFilterAttributes | |
| ldapLoginFilterEmail | 0 |
| ldapLoginFilterMode | 0 |
| ldapLoginFilterUsername | 1 |
| ldapNestedGroups | 0 |
| ldapOverrideMainServer | |
| ldapPagingSize | 0 |
| ldapPort | 389 |
| ldapQuotaAttribute | postOfficeBox |
| ldapQuotaDefault | |
| ldapTLS | 0 |
| ldapUserDisplayName | displayname |
| ldapUserDisplayName2 | |
| ldapUserFilter | (objectclass=
) |
| ldapUserFilterGroups | |
| ldapUserFilterMode | 0 |
| ldapUserFilterObjectclass | |
| ldapUuidGroupAttribute | auto |
| ldapUuidUserAttribute | auto |
| turnOffCertCheck | 0 |
| turnOnPasswordChange | 0 |
| useMemberOfToDetectMembership | 1

Client configuration

Browser: Chrome

Operating system: Window 10

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) ...
@nickvergessen
Copy link
Member

Please check your nextcloud.log file.
It should contain useful information

@mayerthomas
Copy link
Author

mayerthomas commented Oct 14, 2017

Sorry, that it took so long: I brought the instance back to 12.0.2 and can only do testing at weekend.

I updated again to 12.0.3 and there really is no logging about this!

I found out, that the error occurs, when I do not fill in an e-mail-address in the ajax-sharing-form.
The problem for me is: we always took usernames (like a.bcdef) and not e-mail-adresses (like a.bcdef@ghi.jk) for logging in and sharing in nextcloud. That never has been a problem till 12.0.2.

What can I do?

@mayerthomas
Copy link
Author

mayerthomas commented Oct 15, 2017

Some further infos I found out:

  • The error only appears when I share with somebody for whom a (valid) e-mail-address is stored on the ldap-server. When the e-mail-address on ldap for the user to share with is empty, there won't be the error.
  • The error disappears for all sharing-situations (users with or without e-mail in ldap), when I fill in some e-mail-address in the settings under e-mail-server.
  • The error only appears on installations with ldap: when I share to a local nextcloud-database-user that has stored an e-mail-address in his personal settings, there won't be an error.

For the moment I can help myself with storing an e-mail-address in the e-mail-server-settings. But why do I have to fill in an e-mail-address here for sharing ? There isn't any e-mail generated, when I share a folder with somebody else. And I do not want the nextcloud-system to send any e-mails.

This problem started with 12.0.3.

@gmkrab
Copy link

gmkrab commented Oct 16, 2017

I have also error.
Nextcloud version: 12.0.3

From web:
Sharing test.txt failed, could not find username (username@domain), maybe the server is currently unreachable or uses a self-signed certificate.

From server log:
:"Creating advanced filter for search failed, falling back to simple method.

@mathiasconradt
Copy link

mathiasconradt commented Feb 13, 2018

FYI - same error as in the issue title happened to a VAR partner when upgrading from 12.0.5 to 13.0.0, no LDAP though but local users.

A problem occurred while sending the email. Please revise your settings. (Error: Address in mailbox given [webmaster@] does not comply with RFC 2822, 3.6.2.)

@DanLeonelli
Copy link

Happening to me and it's annoying for all the users. Any fix? It's happening whenever someone tries to share something.

@jse3s
Copy link

jse3s commented Feb 16, 2018

Also getting this error in Nextcloud 13 with LDAP users
Address in mailbox given [xxxxx@localhost.localdomain] does not comply with RFC 2822, 3.6.2.

@ironiemix
Copy link

I had the exact same symptoms on a fresh install of NC 13. The problem disappeared after configuring mail in "Settings->Extra Settings", specifically when I entered an email-address to use for sending mails.

@gentoolink
Copy link

I am getting the same error running 13.01

@JaredBoone
Copy link
Contributor

JaredBoone commented Apr 3, 2018

I'm seeing this error when I try to share with another LDAP user after upgrading from 12.0.3 to 13.0.1:

Failed sending activity email to user "jboone": { "Exception":"Swift_RfcComplianceException", "Message":"Address in mailbox given [jared.boone@] does not comply with RFC 2822, 3.6.2.","Code":0, "Trace": "#0 /var/www/html/nextcloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php(261): Swift_Mime_Headers_MailboxHeader->_assertValidAddress('jared.boone@') #1 /var/www/html/nextcloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php(106): Swift_Mime_Headers_MailboxHeader->normalizeMailboxes(Array) #2 /var/www/html/nextcloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php(63): Swift_Mime_Headers_MailboxHeader->setNameAddresses(Array) #3 /var/www/html/nextcloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderFactory.php(58): Swift_Mime_Headers_MailboxHeader->setFieldBodyModel(Array) #4 /var/www/html/nextcloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleHeaderSet.php(68): Swift_Mime_SimpleHeaderFactory->createMailboxHeader('To', Array) #5 /var/www/html/nextcloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Mime/SimpleMessage.php(329): Swift_Mime_SimpleHeaderSet->addMailboxHeader('To', Array) #6 /var/www/html/nextcloud/lib/private/Mail/Message.php(144): Swift_Mime_SimpleMessage->setTo(Array) #7 /var/www/html/nextcloud/apps/activity/lib/MailQueueHandler.php(409): OC\Mail\Message->setTo(Array) #8 /var/www/html/nextcloud/apps/activity/lib/MailQueueHandler.php(183): OCA\Activity\MailQueueHandler->sendEmailToUser('jboone', 'jared.boone@son...', 'en', 'America/Los_Ang...', 1522802100) #9 /var/www/html/nextcloud/apps/activity/lib/BackgroundJob/EmailNotification.php(65): OCA\Activity\MailQueueHandler->sendEmails(500, 1522802100) #10 /var/www/html/nextcloud/lib/private/BackgroundJob/Job.php(61): OCA\Activity\BackgroundJob\EmailNotification->run(NULL) #11 /var/www/html/nextcloud/lib/private/BackgroundJob/TimedJob.php(55): OC\BackgroundJob\Job->execute(Object(OC\BackgroundJob\JobList), Object(OC\Log)) #12 /var/www/html/nextcloud/cron.php(123): OC\BackgroundJob\TimedJob->execute(Object(OC\BackgroundJob\JobList), Object(OC\Log)) #13 {main}", "File":"/var/www/html/nextcloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Mime/Headers/MailboxHeader.php", "Line":345 }

Changing the "From address" on the "Additional Settings" admin page did not help.

@JaredBoone
Copy link
Contributor

JaredBoone commented Apr 4, 2018

OK, I believe I have tracked down the source of this issue.

I'm seeing these DEBUG messages in the nextcloud server log:

idn_to_ascii() expects parameter 3 to be integer, string given at /var/www/html/nextcloud/lib/private/Mail/Message.php#77
Use of undefined constant INTL_IDNA_VARIANT_UTS46 - assumed 'INTL_IDNA_VARIANT_UTS46' at /var/www/html/nextcloud/lib/private/Mail/Message.php#77
idn_to_ascii() expects parameter 3 to be integer, string given at /var/www/html/nextcloud/lib/private/Mail/Mailer.php#212
Use of undefined constant INTL_IDNA_VARIANT_UTS46 - assumed 'INTL_IDNA_VARIANT_UTS46' at /var/www/html/nextcloud/lib/private/Mail/Mailer.php#212

It appears that the domain is being removed from the email address in lib/private/Mail/Mailer.php. Here is a test to confirm the behavior:

-bash-4.1$ php
<?php print "Domain:" . idn_to_ascii('mydomain.com', 0,INTL_IDNA_VARIANT_UTS46) . "\n"; ?>
PHP Notice: Use of undefined constant INTL_IDNA_VARIANT_UTS46 - assumed 'INTL_IDNA_VARIANT_UTS46' in - on line 1
PHP Warning: idn_to_ascii() expects parameter 3 to be integer, string given in - on line 1
Domain:

Apparently, this is because INTL_IDNA_VARIANT_UTS46 was not available in my version of the ICU library.
-bash-4.1$ cat /etc/redhat-release
CentOS release 6.9 (Final)
-bash-4.1$ php -v
PHP 7.0.25 (cli) (built: Oct 29 2017 18:22:34) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
with Zend OPcache v7.0.25, Copyright (c) 1999-2017, by Zend Technologies
-bash-4.1$ php -i | grep "ICU version"
ICU version => 4.2.1

I'm looking for a workaround.

@JaredBoone
Copy link
Contributor

JaredBoone commented Apr 5, 2018

I checked the 13 admin manual and saw that the recommended setup for running Nextcloud is "Red Hat Enterprise Linux 7".
https://docs.nextcloud.com/server/13/admin_manual/installation/system_requirements.html

If this issue is not fixed then I believe the admin manual should be updated to say that RHEL 6 is not supported.

@JaredBoone
Copy link
Contributor

@nickvergessen Please see my earlier comment about the source of this bug. I'd like to know if you'll be providing a minor version fix for this in 13 or if I need to look at moving to CentOS 7.

@JaredBoone
Copy link
Contributor

This commit by @LukasReschke broke support for ICU 4.2.1 which is part of RHEL 6:
70d42af#diff-18a06cff7d62af75d5d48c00afa858cb

@JaredBoone
Copy link
Contributor

Looks like this is a dup of #8387

@JaredBoone
Copy link
Contributor

Created PR to fix this here: #9095

@blizzz
Copy link
Member

blizzz commented Apr 11, 2018

@JaredBoone's PRs are merged → closing

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

No branches or pull requests

10 participants