mirror of
https://github.com/modoboa/modoboa.git
synced 2026-04-26 01:16:01 +03:00
[GH-ISSUE #1190] Unable to delete user/mailbox when user/domain is disabled #974
Labels
No labels
bug
bug
dependencies
design
documentation
duplicate
enhancement
enhancement
enhancement
feedback-needed
help-needed
help-needed
installer
invalid
looking-for-sponsors
modoboa-contacts
new-ui
new-ui
pr
pull-request
pyconfr
python
question
security
stale
webmail
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/modoboa-modoboa#974
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @yannfill on GitHub (Jul 21, 2017).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/1190
When disabling a domain, all mailboxes of that domain are (logically) disabled too. When I try to delete a disabled mailbox, an error shows up: Failed to retrieve mailbox location (userdb lookup: user xxx doesn't exist)
So I must re-enable the domain before being able to delete users, which is kind of weird steps to follow (mailbox disabled -> mailbox enabled -> mailbox deleted).
Disabling a domain or a mailbox could be considered the first step before deleting it, so their should be no need to re-enable it to do that.
@tonioo commented on GitHub (Jul 28, 2017):
@yannfill can you check query used for
iterate_queryin/etc/dovecot/dovecot-sql.conf.extplease?@yannfill commented on GitHub (Jul 28, 2017):
iterate_query = SELECT email AS user FROM core_user WHERE email='%Lu'@yannfill commented on GitHub (Jul 28, 2017):
I also have this in
/etc/dovecot/conf.d/auth-sql.conf.ext:@tonioo commented on GitHub (Jul 28, 2017):
Can you try with this please:
iterate_query = SELECT email AS user FROM core_user@yannfill commented on GitHub (Jul 28, 2017):
Same error, even after restarting Dovecot and Apache.
@tonioo commented on GitHub (Jul 28, 2017):
@yannfill can you show me the full trace please?
@yannfill commented on GitHub (Jul 28, 2017):
I got it, this is my password_query:
When I remove
AND u.is_active=1 AND dom.enabled=1I can delete disabled users. But then, disabled users can still log in, or not ?@tonioo commented on GitHub (Jul 28, 2017):
I don't understand why you encounter this issue, I don't reproduce it...
Do not modify this query otherwise disabled users will still be able to login (IMAP and POP). doveadm only uses
iterate_queryand there is not status filter, that's why I'm a bit lost.@yannfill commented on GitHub (Jul 28, 2017):
My user_query is this:
When I try this command
doveadm mailbox delete -u user@domain TrashI get this error:If I remove
AND dom.enabled=1from the query the same command exit 0 with no output.So, doveadm seems to use all the queries in
/etc/dovecot/dovecot-sql.confexcept iterate_query.@yannfill commented on GitHub (Jul 28, 2017):
And commenting user_query gives this:
@tonioo commented on GitHub (Jul 28, 2017):
Have you tried with
doveadm user(the command used by modoboa)?@yannfill commented on GitHub (Aug 1, 2017):
@tonioo commented on GitHub (Aug 1, 2017):
What happens if you reactivate this user? Does dovecot found it?
@yannfill commented on GitHub (Aug 1, 2017):
I can't reactivate users individually since I have disabled the whole domain, and when I reactivate the domain, I get:
@tonioo commented on GitHub (Aug 1, 2017):
I still can't reproduce this behaviour... What is your dovecot version? Which user runs the doveadm command in your example?
@yannfill commented on GitHub (Aug 1, 2017):
Dovecot 2.2.13
I was root when running the doveadm command, but using dovecot user gives the same results.
@yannfill commented on GitHub (Aug 1, 2017):
According to the wiki,
iterate_queryis used only for a small subset ofdoveadmcommand. I think thatdoveadm userlooks foruser_queryand since my SQL request includesWHEN dom.enabled=1, it makes sense that it fails.@yannfill commented on GitHub (Aug 1, 2017):
That's it, I've removed
dom.enabled=1and now I can delete disabled users, even when the domain is also disabled. Since userdb use prefetch from passdb first for regular user authentication and the SQL query for userdb is only used by doveadm, I think the issue is solved. You can close it if you agree.@tonioo commented on GitHub (Aug 1, 2017):
Could you try to send an email to user in a deactivated domain?
@yannfill commented on GitHub (Aug 1, 2017):
Then the email comes back with Postfix saying
@tonioo commented on GitHub (Aug 9, 2017):
@yannfill Have you checked logs?
@yannfill commented on GitHub (Aug 9, 2017):
From Postfix?
@tonioo commented on GitHub (Dec 7, 2017):
Fixed in the installer:
github.com/modoboa/modoboa-installer@2c206a52b1.