[GH-ISSUE #1990] Renaming an email is only partly successful and results in the email been blocked #1492

Closed
opened 2026-02-27 11:17:23 +03:00 by kerem · 0 comments
Owner

Originally created by @pauldjgh on GitHub (Jul 15, 2020).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/1990

Impacted versions

  • Modoboa: 1.14.0
  • installer used: Yes
  • Webserver: Nginx

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.

Originally created by @pauldjgh on GitHub (Jul 15, 2020). Original GitHub issue: https://github.com/modoboa/modoboa/issues/1990 # Impacted versions * Modoboa: 1.14.0 * installer used: Yes * Webserver: Nginx # 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.
kerem 2026-02-27 11:17:23 +03:00
  • closed this issue
  • added the
    bug
    label
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/modoboa-modoboa#1492
No description provided.