mirror of
https://github.com/modoboa/modoboa.git
synced 2026-04-25 08:56:02 +03:00
[GH-ISSUE #1990] Renaming an email is only partly successful and results in the email been blocked #1492
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#1492
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 @pauldjgh on GitHub (Jul 15, 2020).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/1990
Impacted versions
Steps to reproduce
In Edit Identity of a user (admin/identities/#list/) - edit the user, change the Username and click Update
Current behavior
The Username changes, In server/vmail/domain directory - 2 mailboxes now exist - oldname and newname
No email are transfered.
The admin_mailboxoperation table still has an uncompleted rename operations - so blocking all incoming emails to this account
User login using the new username and is able to send email. But old emails are missing
Expected behavior
Username is change. All emails moved, etc. Only one user mailbox in mail directory. User is able to receive emails
Error Message
The error message is
modoboa.admin.management.commands.handle_mailbox_operations.OperationError: b"mv: cannot move '/srv/vmail/domain/test' to 'b/srv/vmail/domain/test2': No such file or directory\n"
Notice the "b/srv/domain" - which is a sign that the new mailbox path needed to be decoded and was not
Possible Solution
changing line 45 of site-packages/modoboa/admin/management/commands/handle_mailbox_operations.py from
new_mail_home = operation.mailbox.mail_home
to
new_mail_home = operation.mailbox.mail_home.decode('utf-8')
fixes the error and rename then works
This property comes from site-packages/modoboa/admin/models/mailboxes.py and is set there with a dovecot command.
I think this should be fixed here but I am not sure where else this is used or if it is only a problem on my machine.