Christian Rohmann
2016-Jan-27 13:53 UTC
Can you "doveadm search" with mailbox location instead of a user (-u option)?
Hey dovecot-users! doveadm import offers to use i.e. a maildir as source and then import into a users mailbox referenced via "-u" option. If one wants to import only certain emails from the source a search-query can be given as well. I was wondering if doveadm search also does offer to search a mailbox referenced by filesystem path i.e. doveadm search maildir:/srv/mailboxes/example.com/mailbox123 NEW Maybe a fixed mailbox location via "-o mailbox_location=maildir:/srv/mailboxes/example.com/mailbox123" does work, but then it's rather a side effect as one needs to define a user via "-u" parameter anyways. Regards Christian
Timo Sirainen
2016-Jan-29 14:41 UTC
Can you "doveadm search" with mailbox location instead of a user (-u option)?
> On 27 Jan 2016, at 15:53, Christian Rohmann <crohmann at netcologne.de> wrote: > > Hey dovecot-users! > > > doveadm import offers to use i.e. a maildir as source and then import > into a users mailbox referenced via "-u" option. If one wants to import > only certain emails from the source a search-query can be given as well.Yes, because import is importing mails from one location to another.> I was wondering if doveadm search also does offer to search a mailbox > referenced by filesystem path i.e.Whereas search uses only one location.> doveadm search maildir:/srv/mailboxes/example.com/mailbox123 NEW > > > Maybe a fixed mailbox location via "-o > mailbox_location=maildir:/srv/mailboxes/example.com/mailbox123" does > work, but then it's rather a side effect as one needs to define a user > via "-u" parameter anyways.You can use: doveadm -o mail=maildir:/srv/mailboxes/example.com/mailbox123 search new You don't actually have to use the -u parameter, although doveadm may be using the wrong UID/GID/home then.
Christian Rohmann
2016-Feb-02 10:52 UTC
Can you "doveadm search" with mailbox location instead of a user (-u option)?
On 01/29/2016 03:41 PM, Timo Sirainen wrote:> You can use: > > doveadm -o mail=maildir:/srv/mailboxes/example.com/mailbox123 search new > > You don't actually have to use the -u parameter, although doveadm may be using the wrong UID/GID/home then.Awesome. Maybe the usage output # /opt/dovecot/bin/doveadm search doveadm search [-u <user>|-A] [-S <socket_path>] <search query> should then not tell the user that "-u" needs to be given or better explain that "-o mail=" is also a valid way to define which mailbox. Thanks again Timo for one versatile piece of good software! Christian