Open jpkop opened 1 year ago
The error should also happen when sending the test email from index.php/settings/admin
right?
The error should also happen when sending the test email from
index.php/settings/admin
right?
The error message below does appear in the log, the upper ones do not (since the mail is adressed to me and not to the deleted users).
+1, Problem persists in NextCloud 24.0.8 Users removed from ladp, system still trying to send emails to removed (from ldap group) users.
{"reqId":"968SxTD1FT27CdfgY6bs","level":3,"time":"2023-08-30T12:30:38+00:00","remoteAddr":"","user":"--","app":"activity","method":"","url":"--","message":"Failed sending activity email to user \"bd8ad2dc-0129-103d-901a-6f7a8ddc7eb7\"","userAgent":"--","version":"25.0.8.2","exception":{"Exception":"Swift_TransportException","Message":"Expected response code 354 but got code \"503\", with message \"503-All RCPT commands were rejected with this error:\r\n503-This user shouldn't receive messages\r\n503 Valid RCPT command must precede DATA\r\n\"","Code":503,"Trace":[{"file":"/var/www/html/nextcloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php","line":344,"function":"assertResponseCode","class":"Swift_Transport_AbstractSmtpTransport","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/EsmtpTransport.php","line":305,"function":"executeCommand","class":"Swift_Transport_AbstractSmtpTransport","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php","line":392,"function":"executeCommand","class":"Swift_Transport_EsmtpTransport","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php","line":499,"function":"doDataCommand","class":"Swift_Transport_AbstractSmtpTransport","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php","line":518,"function":"doMailTransaction","class":"Swift_Transport_AbstractSmtpTransport","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php","line":206,"function":"sendTo","class":"Swift_Transport_AbstractSmtpTransport","type":"->"},{"file":"/var/www/html/nextcloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Mailer.php","line":71,"function":"send","class":"Swift_Transport_AbstractSmtpTransport","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/Mail/Mailer.php","line":191,"function":"send","class":"Swift_Mailer","type":"->"},{"file":"/var/www/html/nextcloud/apps/activity/lib/MailQueueHandler.php","line":415,"function":"send","class":"OC\Mail\Mailer","type":"->"},{"file":"/var/www/html/nextcloud/apps/activity/lib/MailQueueHandler.php","line":165,"function":"sendEmailToUser","class":"OCA\Activity\MailQueueHandler","type":"->"},{"file":"/var/www/html/nextcloud/apps/activity/lib/BackgroundJob/EmailNotification.php","line":61,"function":"sendEmails","class":"OCA\Activity\MailQueueHandler","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/BackgroundJob/Job.php","line":54,"function":"run","class":"OCA\Activity\BackgroundJob\EmailNotification","type":"->"},{"file":"/var/www/html/nextcloud/lib/private/BackgroundJob/TimedJob.php","line":60,"function":"execute","class":"OC\BackgroundJob\Job","type":"->"},{"file":"/var/www/html/nextcloud/cron.php","line":152,"function":"execute","class":"OC\BackgroundJob\TimedJob","type":"->"}],"File":"/var/www/html/nextcloud/3rdparty/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php","Line":459,"message":"Failed sending activity email to user \"{user}\"","CustomMessage":"Failed sending activity email to user \"bd8ad2dc-0129-103d-901a-6f7a8ddc7eb7\""},"id":"64ef366edf63e"}
I looked further into subject and Activity might be only partially wrong. The users that generate the error are no longer in occ user:list, but then i ask occ:info {cloud_id} i stil get data:
sudo -u www-data php /var/www/html/nextcloud/occ user:info bd8ad2dc-0129-103d-901a-6f7a8ddc7eb7
- user_id: bd8ad2dc-0129-103d-901a-6f7a8ddc7eb7
- display_name: bd8ad2dc-0129-103d-901a-6f7a8ddc7eb7
- email: #REDACTED#
- cloud_id: bd8ad2dc-0129-103d-901a-6f7a8ddc7eb7@#REDACTED#
- enabled: true
- groups:
- quota: 10 GB
- storage:
- last_seen: 1970-01-01T00:00:00+00:00
- user_directory: #REDACTED#
- backend: LDAP
Thus, I would suspect, that Activity tries to send activity emails to all detected users, that are still in the system (even is not visible). The nextcloud does not delete these accounts (which might be desired behaviour).
The desired behaviour would be to take list for processing from occ user:list like source, not DB itself.
edit.
I looked further, Nextcloud has a background process called LDAP user cleanup that marks disconnected accounts. They can be seen with:
sudo -u www-data php /var/www/html/nextcloud/occ ldap:show-remnants
The idea is to filter these entries from Activity email processing list.
Problem persists in NextCloud 24.0.8
That version is not supported anymore, please update to a supported version and try again.
I had the same issue with the disabled LDAP users, and It's been going on for awhile now. Most recent version on my side was 28.0.1.1 and the issue persists.
Hi,
From my understanding, emails should not be sent to disabled users (see this condition ). However, from my experience, remnants LDAP users have a isDeleted
configkey set to 1
in oc_preferences
but that doesn't disable them. (as seen through a occ user:info
on the same userid)
Activity app might not be the right place to address this problem as this app isn't supposed to cover all user backends possible. Maybe a user_ldap issue?
I'm also concerned by the issue of Nextcloud trying to send email notifications to remnants. @nickvergessen What's your take on this?
Best regards,
Hello Any news on this subject? Regards,
Hello.
we face the following issue: Some former users were deleted via ldap. It seems that there were pending activity mails for these users in the outbox that can not be delivered. Each time the cron job runs we get the log entries down below. We first saw this problems after upgrading to 25.0.1 (from 24.0.5).
Is there a way to manually purge this outbox or solve the issue otherwise?
Thanks in advance.
Server configuration
Operating system: Ubuntu 20.04.5
Web server: nginx
Database: postgresql
PHP version: 8.1.12
Nextcloud version: 25.0.1.1
Where did you install Nextcloud from: docker-compose file
Signing status: Not sure what this means
Nextcloud configuration:
Logs
Nextcloud log (data/nextcloud.log)