mirror of
https://github.com/opensolutions/ViMbAdmin.git
synced 2026-04-26 00:36:00 +03:00
[GH-ISSUE #285] Batch edit one Goto Adress used in hundred of Aliases Adresses #232
Labels
No labels
bug
feature
feature
improvement
improvement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ViMbAdmin-opensolutions#232
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 @agaricus-campestris on GitHub (Apr 6, 2022).
Original GitHub issue: https://github.com/opensolutions/ViMbAdmin/issues/285
Hi,
Context :
I have ViMbAdmin V3.0.15, I know I need to update it, but I can't really do it right now.
Also, I'm not sure how this could be done on server-side or if there is a feature in newer versions, I couldn't find what I'm looking for with searching for « batch » words on Wiki & Git Issues, I'm sorry if I make you lose time here.
Question :
Is there any way, within Web Admin or on Command Line Server side, to batch edit one Goto adress that is used for a hundred Aliases Addresses ? I do have a lot of them so I really don't want to modify all that manually :s
Thanks a lot to anyone reading this, I hope my question is understandable as I'm not english native speaker,
@barryo commented on GitHub (Apr 6, 2022):
Hi @ValentinDrean - I'm not sure what this feature would look like in the UI. But to confirm - you are correct - no such functionality exists.
If this were me, I think I'd handle with with a script and hit the database directly.
@agaricus-campestris commented on GitHub (Apr 6, 2022):
Thank you @barryo so much for this super quick answer (◍•ᴗ•◍)
Even if you closed this, I respond here to show the method I used, so if there is anyone seeing this, maybe it'll help.
⚠️ Always dry-run / simulate sql queries when using
UPDATEand double check values you're editing by using SELECT, otherwise you may be messing your ViMbAdmin database a lot ⚠️I'm not a SQL-ninja but I managed to solve this by using
replace()SQL function :THIS, was working because
A@XXX.orgwas completely unique in my goto column, IF I had other adresses used in goto column likesomethingA@XXX.org: replace() function would have changed it tonewMailB@XXX.org, which we don't want becauseA@XXX.org&somethingA@XXX.orgare not the same address.So please be careful, as my solution may not work as expected 😨.
This would be similar if you wan't to remove one same address that appears in multiple
gotorows, and this would even be harder because of commas everywhere.PS : speaking of commas, is this normal database scheme having multiple values in a delimited string column (for goto) ? Sorry maybe this is a noob question.
Thanks again, hope this will help somehow,
@barryo commented on GitHub (Apr 6, 2022):
Not a noob question but a very good one. The answer is no but this is essentially what we inherited from Postfix / Postfixadmin and we wanted to go for ease of migration way back when we started.
@barryo commented on GitHub (Apr 6, 2022):
On the SQL, what I'd be inclined to do is have a script like this (php-ish / pseudo code):
For the database side then I'd run a SQL query like: