[GH-ISSUE #289] Database column mailbox.username is not unique #237

Closed
opened 2026-02-26 09:36:58 +03:00 by kerem · 1 comment
Owner

Originally created by @PhrozenByte on GitHub (Jul 13, 2022).
Original GitHub issue: https://github.com/opensolutions/ViMbAdmin/issues/289

mailbox.username currently isn't required to be unique in the database (uniqueness is currently only enforced by code), nor is the column even indexed. Querying the ViMbAdmin database using mailbox.username as (supposed to be unique) identifier is one of the main database queries any mail server software (Dovecot, Postfix, etc.) performs frequently (up to thousands of queries a day, depending on the number of users). mailbox.local_part should be indexed, too.

Originally created by @PhrozenByte on GitHub (Jul 13, 2022). Original GitHub issue: https://github.com/opensolutions/ViMbAdmin/issues/289 `mailbox`.`username` currently isn't required to be unique in the database (uniqueness is currently only [enforced by code](https://github.com/opensolutions/ViMbAdmin/blob/6fc7b6a7be3eb9264b27caf4e48d8c90bafc3ce9/application/controllers/MailboxController.php#L282-L290)), nor is the column even indexed. Querying the ViMbAdmin database using `mailbox`.`username` as (supposed to be unique) identifier is one of the main database queries any mail server software (Dovecot, Postfix, etc.) performs frequently (up to thousands of queries a day, depending on the number of users). `mailbox`.`local_part` should be indexed, too.
kerem closed this issue 2026-02-26 09:36:59 +03:00
Author
Owner

@barryo commented on GitHub (Feb 23, 2023):

Good catch. Fixed in 5836ad571a and can be updated via:

# sanity check the output of:
./bin/doctrine2-cli.php orm:schema-tool:update --dump-sql

# and then run:
./bin/doctrine2-cli.php orm:schema-tool:update --force
<!-- gh-comment-id:1442507622 --> @barryo commented on GitHub (Feb 23, 2023): Good catch. Fixed in 5836ad571a5017351605a341c1a3c5c02e348e3c and can be updated via: ``` # sanity check the output of: ./bin/doctrine2-cli.php orm:schema-tool:update --dump-sql # and then run: ./bin/doctrine2-cli.php orm:schema-tool:update --force ```
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/ViMbAdmin-opensolutions#237
No description provided.