> doveadm expunge -u <user> mailbox '*' savedbefore 30dThat doesn't work for me either. The command is accepted, but the messages are not expunged. I guess my search/fetch will just have to return the mailbox name, in addition to other fields, and then I'll need to loop through the mailbox names and perform multiple expunges for each user. I understand the desire to avoid accidents by requiring that the mailbox be specified. But if "mailbox ALL" or "mailbox '*' were allowed, that would still avoid the accident and yet also avoid the inefficiency of having to perform multiple expunges for one user. *** Enhancement request: provide a "mailbox all" or "mailbox '*'" option for doveadm search_query so that expunge can be used to remove mail without regard to which mailbox it's in.> Are you sure you really want to do this? My server expunges Trash and > Junk on a cycle, but reaching into other mailboxes seems iffy.Yes. I understand it's unusual. This is an RF (radio) application for emergency services. We have to be efficient about channel utilization. Users know they need to keep their mailboxes clean so that, at the start of an emergency (or other incident), the channel is not clogged with downloading lots of old, irrelevant mail. If they haven't logged in for a while, we'll keep it clear for them. Michael
On 30-12-16 17:03, Michael Fox wrote:>> doveadm expunge -u <user> mailbox '*' savedbefore 30d > > That doesn't work for me either. The command is accepted, but the messages > are not expunged. > > I guess my search/fetch will just have to return the mailbox name, in > addition to other fields, and then I'll need to loop through the mailbox > names and perform multiple expunges for each user. I understand the desire > to avoid accidents by requiring that the mailbox be specified. But if > "mailbox ALL" or "mailbox '*' were allowed, that would still avoid the > accident and yet also avoid the inefficiency of having to perform multiple > expunges for one user. > > > *** Enhancement request: provide a "mailbox all" or "mailbox '*'" option > for doveadm search_query so that expunge can be used to remove mail without > regard to which mailbox it's in. >How i read the docs here: http://wiki2.dovecot.org/Tools/Doveadm/SearchQuery and here: http://wiki2.dovecot.org/Tools/Doveadm/Expunge Is what i can test, but i will/can not test 'expunge' ... luuk at opensuse:~> doveadm search ALL savedbefore 1800d 0d41613267fb0e4f28190000bbf0c0ec 1 0d41613267fb0e4f28190000bbf0c0ec 2 0d41613267fb0e4f28190000bbf0c0ec 3 luuk at opensuse:~> doveadm fetch date.received ALL before 1800d | sed 's/^L//g' date.received: 2012-01-12 16:11:09 date.received: 2012-01-12 16:25:27 date.received: 2012-01-12 17:26:23 date.received: 2012-01-12 17:27:15 luuk at opensuse:~> After this, i think this should work: daveadm expunge ALL before 1800d or, in you case: doveadm expunge -u <user> ALL savedbefore 30d if this is not working, that this might be a bug?
On 12/30/2016 11:03 AM, Michael Fox wrote:>> doveadm expunge -u <user> mailbox '*' savedbefore 30d > > That doesn't work for me either. The command is accepted, but the messages > are not expunged.Huh, it certainly did for me, although I used "all" instead of "savedbefore 30d" since I just wanted to empty the trash. What version of Dovecot? Mine is 2.2.27.>> Are you sure you really want to do this? My server expunges Trash and >> Junk on a cycle, but reaching into other mailboxes seems iffy. > > Yes. I understand it's unusual. This is an RF (radio) application for > emergency services. We have to be efficient about channel utilization. > Users know they need to keep their mailboxes clean so that, at the start of > an emergency (or other incident), the channel is not clogged with > downloading lots of old, irrelevant mail. If they haven't logged in for a > while, we'll keep it clear for them.I guess that's reasonable for a critical application, but normally I would expect an IMAP client to request headers-only, or just recent messages. My phone's K9 client defaults to something like 2 weeks. Tom.
> Huh, it certainly did for me, although I used "all" instead of > "savedbefore 30d" since I just wanted to empty the trash. What > version of Dovecot? Mine is 2.2.27.Well, not for me. doveadm search -u user at domain ALL savedbefore 2d -- returns some messages doveadm expunge -u user at domain mailbox '*' savedbefore 2d -- nothing shown, but no error doveadm search -u user at domain ALL savedbefore 2d -- returns the same messages as before I've got 2.2.9 (Ubuntu package for 14.04)> I guess that's reasonable for a critical application, but normally I > would expect an IMAP client to request headers-only, or just recent > messages. My phone's K9 client defaults to something like 2 weeks.Right. But your phone has 100s of kbps or even Mbps of bandwidth, full duplex. But when multiple users are sharing a simplex 56kbps radio channel, even just the headers of old/irrelevant mail are to be avoided. Michael