Hello
Using CLI only, I do a zmmailbox search to find a message and then I can move it to an other folder.
Is-it possible to move (or copy) a message to an other mailbox folder ?
Regards,
Victor
Move a message to an other mailbox using CLI only
-
- Posts: 43
- Joined: Mon Apr 11, 2016 11:59 am
Re: Move a message to an other mailbox using CLI only
Use Imapsync to move a single message is an overkill
1. Find your the id of your message searching it in the source@mydomain.com account. The id is in the first column.
zmmailbox -z -m source@mydomain.com s -t message "[your search query]"
2. Locate the blobfile on the volume:
zmmetadump -m source@mydomain.com -i 28454
3. Inject that blobfile directly in the desided folder of the destination@mydomain.com user:
zmmailbox -z -m destination@mydomain.com addMessage /Inbox/myfolder /opt/zimbra/store/0/1/msg/6/28454-82395.msg
4. If you want to perform move, you can delete the original after the inject:
zmmailbox -z -m source@mydomain.com deleteMessage 28454
You can inject multiple blobfile if my memory is correct.
I don't remember if metadata are kept or are set to new. Read/unread surely is not kept. Delivery date is calculated.
1. Find your the id of your message searching it in the source@mydomain.com account. The id is in the first column.
zmmailbox -z -m source@mydomain.com s -t message "[your search query]"
Code: Select all
Id Type From Subject Date
----- ---- -------------------- -------------------------------------------------- --------------
1. 28454 mess a xxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxx 10/14/19 06:26
2. 28453 mess b yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy 10/13/19 06:26
3. 28452 mess c zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz 10/12/19 06:26
zmmetadump -m source@mydomain.com -i 28454
Code: Select all
....
uuid: <null>
[Blob Path]
/opt/zimbra/store/0/1/msg/6/28454-82395.msg
[Metadata]
....
zmmailbox -z -m destination@mydomain.com addMessage /Inbox/myfolder /opt/zimbra/store/0/1/msg/6/28454-82395.msg
4. If you want to perform move, you can delete the original after the inject:
zmmailbox -z -m source@mydomain.com deleteMessage 28454
You can inject multiple blobfile if my memory is correct.
I don't remember if metadata are kept or are set to new. Read/unread surely is not kept. Delivery date is calculated.
-
- Posts: 47
- Joined: Tue Oct 04, 2016 9:54 pm
Re: Move a message to an other mailbox using CLI only
dont want to necropost but is there another way that does not involve CLI only?