[Bug]: LDAP mail attribute of users not updated in NextCloud data (primary email)
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 36.9k
- Forks
- 5.2k
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 713
Description
⚠️ This issue respects the following points: ⚠️
- This is a bug, not a question or a configuration/webserver/proxy issue.
- This issue is not already reported on Github OR Nextcloud Community Forum (I've searched it).
- Nextcloud Server is up to date. See Maintenance and Release Schedule for supported versions.
- I agree to follow Nextcloud's Code of Conduct.
Bug description
This is an identical issue as seen in #8304 which was closed, however the user's email address is not dupated despite adding mail to the Email Field special attribute in the LDAP advanced settings (as mentioned by @dphilly in #8304). Waiting a few days and/or running ldap:check-user --update <username> also doesn't show the email address or help here even though the mail field is set in Active Directory:
I ended up just setting the email manually on each user using LuXc-NL's method.
Steps to reproduce
-
Enter user in LDAP -
First user login on Nextcloud -
User notices that email is not set -
User is adding primary email on ldap -
Nextcloud does not updating the email attribute
Expected behavior
User email addresses that are in LDAP should be carried over to the users in Nextcloud.
Installation method
Community VM appliance
Nextcloud Server version
27
Operating system
Debian/Ubuntu
PHP engine version
PHP 8.2
Web server
Apache (supported)
Database engine version
PostgreSQL
Is this bug present after an update or on a fresh install?
None
Are you using the Nextcloud Server Encryption module?
None
What user-backends are you using?
- Default user-backend (database)
- LDAP/ Active Directory
- SSO - SAML
- Other
Configuration report
{
"system": {
"passwordsalt": "***REMOVED SENSITIVE VALUE***",
"secret": "***REMOVED SENSITIVE VALUE***",
"trusted_domains": [
"localhost",
"192.168.0.11",
"nextcloud.empirenatgas.com",
"nextcloud"
],
"trusted_proxies": "***REMOVED SENSITIVE VALUE***",
"datadirectory": "***REMOVED SENSITIVE VALUE***",
"dbtype": "pgsql",
"version": "27.1.2.1",
"overwrite.cli.url": "https:\/\/nextcloud.empirenatgas.com\/",
"dbname": "***REMOVED SENSITIVE VALUE***",
"dbhost": "***REMOVED SENSITIVE VALUE***",
"dbport": "",
"dbtableprefix": "oc_",
"dbuser": "***REMOVED SENSITIVE VALUE***",
"dbpassword": "***REMOVED SENSITIVE VALUE***",
"installed": true,
"instanceid": "***REMOVED SENSITIVE VALUE***",
"upgrade.disable-web": true,
"log_type": "file",
"logfile": "\/var\/log\/nextcloud\/nextcloud.log",
"loglevel": "2",
"log.condition": {
"apps": [
"admin_audit"
]
},
"mail_smtpmode": "smtp",
"remember_login_cookie_lifetime": "1800",
"log_rotate_size": "10485760",
"trashbin_retention_obligation": "auto, 60",
"versions_retention_obligation": "auto, 180",
"activity_expire_days": "120",
"simpleSignUpLink.shown": false,
"memcache.local": "\\OC\\Memcache\\Redis",
"filelocking.enabled": true,
"memcache.distributed": "\\OC\\Memcache\\Redis",
"memcache.locking": "\\OC\\Memcache\\Redis",
"redis": {
"host": "***REMOVED SENSITIVE VALUE***",
"port": 0,
"timeout": 0.5,
"dbindex": 0,
"password": "***REMOVED SENSITIVE VALUE***"
},
"default_phone_region": "us",
"logtimezone": "US\/Eastern",
"htaccess.RewriteBase": "\/",
"maintenance": false,
"mail_from_address": "***REMOVED SENSITIVE VALUE***",
"mail_sendmailmode": "smtp",
"mail_domain": "***REMOVED SENSITIVE VALUE***",
"mail_smtpsecure": "ssl",
"mail_smtpauthtype": "LOGIN",
"mail_smtpauth": 1,
"mail_smtphost": "***REMOVED SENSITIVE VALUE***",
"mail_smtpport": "465",
"mail_smtpname": "***REMOVED SENSITIVE VALUE***",
"mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
"ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory"
}
}
List of activated Apps
Enabled:
- activity: 2.19.0
- admin_audit: 1.17.0
- analytics: 4.11.0
- analytics_sourcepack: 0.0.2
- approval: 1.1.0
- bookmarks: 13.1.1
- bruteforcesettings: 2.7.0
- calendar: 4.5.3
- calendar_resource_management: 0.5.0
- cloud_federation_api: 1.10.0
- comments: 1.17.0
- dashboard: 7.7.0
- dav: 1.27.0
- event_update_notification: 2.2.0
- external: 5.2.1
- federatedfilesharing: 1.17.0
- files: 1.22.0
- files_accesscontrol: 1.17.1
- files_automatedtagging: 1.17.0
- files_confidential: 2.0.1
- files_external: 1.19.0
- files_pdfviewer: 2.8.0
- files_reminders: 1.0.0
- files_retention: 1.16.0
- files_rightclick: 1.6.0
- files_sharing: 1.19.0
- files_trashbin: 1.17.0
- files_versions: 1.20.0
- firstrunwizard: 2.16.0
- impersonate: 1.14.0
- logreader: 2.12.0
- lookup_server_connector: 1.15.0
- nextcloud_announcements: 1.16.0
- notifications: 2.15.0
- oauth2: 1.15.1
- password_policy: 1.17.0
- privacy: 1.11.0
- provisioning_api: 1.17.0
- recommendations: 1.6.0
- related_resources: 1.2.0
- richdocuments: 8.2.2
- serverinfo: 1.17.0
- settings: 1.9.0
- sharebymail: 1.17.0
- suspicious_login: 5.0.0
- systemtags: 1.17.0
- tasks: 0.15.0
- text: 3.8.0
- theming: 2.2.0
- twofactor_backupcodes: 1.16.0
- twofactor_totp: 9.0.0
- updatenotification: 1.17.0
- user_ldap: 1.17.0
- viewer: 2.1.0
- weather_status: 1.7.0
- workflow_ocr: 1.27.5
- workflowengine: 2.9.0
Disabled:
- accessibility: 1.10.0
- announcementcenter: 6.6.2 (installed 6.6.2)
- apporder: 0.15.0 (installed 0.15.0)
- circles: 27.0.1 (installed 22.1.1)
- contacts: 5.4.2 (installed 5.4.2)
- contactsinteraction: 1.8.0 (installed 1.5.0)
- encryption: 2.15.0
- extract: 1.3.6 (installed 1.3.6)
- federation: 1.17.0 (installed 1.13.0)
- files_fulltextsearch: 27.0.1 (installed 27.0.1)
- files_videoplayer: 1.13.0
- fulltextsearch: 27.0.2 (installed 27.0.2)
- fulltextsearch_elasticsearch: 27.0.4 (installed 27.0.4)
- mailnotifier: 0.0.3 (installed 0.0.3)
- photos: 2.3.0 (installed 1.4.0)
- richdocumentscode: 23.5.503 (installed 23.5.503)
- support: 1.10.0 (installed 1.6.0)
- survey_client: 1.15.0 (installed 1.11.0)
- tables: 0.6.1 (installed 0.6.1)
- user_status: 1.7.0 (installed 1.3.1)
Nextcloud Signing status
No errors have been found.
Nextcloud Logs
No response
Additional info
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in the user_ldap app and trace the ldap:check-user --update command and the LDAP email-field handling. Reproduce the flow by adding a mail attribute after first login, then verify that the Nextcloud primary email is updated without manual intervention.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- authentication, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100