[GH-ISSUE #105] AliasRepository::loadWithMailbox() has wrong like-check #81

Closed
opened 2026-02-26 09:35:41 +03:00 by kerem · 8 comments
Owner

Originally created by @liayn on GitHub (Jul 16, 2014).
Original GitHub issue: https://github.com/opensolutions/ViMbAdmin/issues/105

If you have a mailbox called lastname@example.com and an alias
something@example.com -> admin@example.com, firstname.lastname@example.com

AliasRepository::loadWithMailbox() will also include this alias although it is completely unrelated. This causes a problem when purging mailboxes, as they try to delete this alias too.

The SQL like query should be replaced to something like find_in_set() or, if that is not doable due to other DBs not supporting it, one can choose
a.goto like ',' & ?2 OR a.goto like ?2 & ','

Originally created by @liayn on GitHub (Jul 16, 2014). Original GitHub issue: https://github.com/opensolutions/ViMbAdmin/issues/105 If you have a mailbox called lastname@example.com and an alias something@example.com -> admin@example.com, firstname.lastname@example.com AliasRepository::loadWithMailbox() will also include this alias although it is completely unrelated. This causes a problem when purging mailboxes, as they try to delete this alias too. The SQL like query should be replaced to something like find_in_set() or, if that is not doable due to other DBs not supporting it, one can choose `a.goto like ',' & ?2 OR a.goto like ?2 & ','`
kerem closed this issue 2026-02-26 09:35:41 +03:00
Author
Owner

@liayn commented on GitHub (Jul 16, 2014):

Correction: It odes of course not delete the alias, but the listing is wrong

<!-- gh-comment-id:49200067 --> @liayn commented on GitHub (Jul 16, 2014): Correction: It odes of course not delete the alias, but the listing is wrong
Author
Owner

@PhrozenByte commented on GitHub (Jul 22, 2014):

My humble opinion: Maybe it would be the best and most flexible solution to change the database scheme and store multiple goto addresses in multiple rows.

<!-- gh-comment-id:49803131 --> @PhrozenByte commented on GitHub (Jul 22, 2014): My humble opinion: Maybe it would be the best and most flexible solution to change the database scheme and store multiple goto addresses in multiple rows.
Author
Owner

@liayn commented on GitHub (Jul 22, 2014):

Of course a clean 1:n scheme would be best, but then you need to join them to a string again for the postfix query, which is not so nice and not very fast.
That's why I didn't suggest this.

<!-- gh-comment-id:49804347 --> @liayn commented on GitHub (Jul 22, 2014): Of course a clean 1:n scheme would be best, but then you need to join them to a string again for the postfix query, which is not so nice and not very fast. That's why I didn't suggest this.
Author
Owner

@PhrozenByte commented on GitHub (Jul 22, 2014):

You mustn't. Postfix treats comma-separated lists and multiple rows equally.

<!-- gh-comment-id:49805044 --> @PhrozenByte commented on GitHub (Jul 22, 2014): You mustn't. Postfix treats comma-separated lists and multiple rows equally.
Author
Owner

@liayn commented on GitHub (Jul 22, 2014):

Oh really. Didn't know that.
Then I propose an immediate DB scheme update.
(I don't like denormalized DBs. You only run into troubles in the long-run.)

<!-- gh-comment-id:49805269 --> @liayn commented on GitHub (Jul 22, 2014): Oh really. Didn't know that. Then I propose an immediate DB scheme update. (I don't like denormalized DBs. You only run into troubles in the long-run.)
Author
Owner

@barryo commented on GitHub (Jul 23, 2014):

Maybe it would be the best and most flexible solution to change the database scheme and
store multiple goto addresses in multiple rows.

The current schema is a hangover from Postfixadmin.

Schema changes are disruptive for existing users and thus we would be disinclined to make any large schema change without a major new release.

<!-- gh-comment-id:49840510 --> @barryo commented on GitHub (Jul 23, 2014): > Maybe it would be the best and most flexible solution to change the database scheme and > store multiple goto addresses in multiple rows. The current schema is a hangover from Postfixadmin. Schema changes are disruptive for existing users and thus we would be disinclined to make any large schema change without a major new release.
Author
Owner

@liayn commented on GitHub (Jul 23, 2014):

Then at least fix the SQL stmt as mentioned above please!

<!-- gh-comment-id:49847469 --> @liayn commented on GitHub (Jul 23, 2014): Then at least fix the SQL stmt as mentioned above please!
Author
Owner

@liayn commented on GitHub (Jan 5, 2016):

Ping...

<!-- gh-comment-id:169168348 --> @liayn commented on GitHub (Jan 5, 2016): Ping...
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#81
No description provided.