find mailbox (path) of message
How should I use 'doveadm search -u' to get the mailbox path where the message is stored?
- Marc via dovecot:
How should I use 'doveadm search -u' to get the mailbox path where the message is stored?
https://doc.dovecot.org/main/core/man/doveadm-search.1.html states:
doveadm-search(1) - Show a list of mailbox GUIDs and message UIDs matching given search query.
I don't see how the search command could be used to return some kind of "path". Dovecot message stores are an abstraction layer. There are also mailbox formats like mdbox (multi-dbox) to consider, where a single file system object can contain multiple messages.
-Ralph
On 2024-12-20 11:33 p.m., Ralph Seichter via dovecot wrote:
- Marc via dovecot:
How should I use 'doveadm search -u' to get the mailbox path where the message is stored? https://doc.dovecot.org/main/core/man/doveadm-search.1.html states:
doveadm-search(1) - Show a list of mailbox GUIDs and message UIDs matching given search query.
I don't see how the search command could be used to return some kind of "path".
As mentioned in the man page, use doveadm-search in combination with doveadm-fetch. To display the mailbox name and some headers (instead of fetching the entire message) use, for example:
doveadm search -u username [SEARCH PATTERN] | while read guid uid; do doveadm fetch -u username "mailbox hdr.subject hdr.date" mailbox-guid $guid uid $uid done
How should I use 'doveadm search -u' to get the mailbox path where
the
message is stored? https://doc.dovecot.org/main/core/man/doveadm-search.1.html states:
doveadm-search(1) - Show a list of mailbox GUIDs and message UIDs matching given search query.
I don't see how the search command could be used to return some kind of "path".
As mentioned in the man page, use doveadm-search in combination with doveadm-fetch. To display the mailbox name and some headers (instead of fetching the entire message) use, for example:
doveadm search -u username [SEARCH PATTERN] | while read guid uid; do doveadm fetch -u username "mailbox hdr.subject hdr.date" mailbox-guid $guid uid $uid done
I can't remember what I did. I am not sure if this works with having multiple namespaces. I can remember just iterating of the mailboxes and searching them.
On 13/01/2025 18:25 EET Marc via dovecot <dovecot@dovecot.org> wrote:
How should I use 'doveadm search -u' to get the mailbox path where
the
message is stored? https://doc.dovecot.org/main/core/man/doveadm-search.1.html states:
doveadm-search(1) - Show a list of mailbox GUIDs and message UIDs matching given search query.
I don't see how the search command could be used to return some kind of "path".
As mentioned in the man page, use doveadm-search in combination with doveadm-fetch. To display the mailbox name and some headers (instead of fetching the entire message) use, for example:
doveadm search -u username [SEARCH PATTERN] | while read guid uid; do doveadm fetch -u username "mailbox hdr.subject hdr.date" mailbox-guid $guid uid $uid done
I can't remember what I did. I am not sure if this works with having multiple namespaces. I can remember just iterating of the mailboxes and searching them.
You can use
doveadm mailbox path INBOX
to get path to mailbox.
For some mailbox formats, you can use storageid to figure out the filename, e.g. maildir. For others, like sdbox, you can just deduce it from uid.
Aki
Aki
participants (4)
-
Aki Tuomi
-
Marc
-
Oscar del Rio
-
Ralph Seichter