So, along with the problem of lots of folders ending in 1 1 1 1, I'd like to have a strategy to delete these.
I was trying to understand if it is possible to use http://linux.die.net/man/1/doveadm-expunge to delete empty folders, but without also deleting messages? Is this possible and if so what is the syntax?
Kind regards, Samuel
With doveadm mailbox status -u ... messages"*" There is a list of folders and the number of messages and then with doveadm mailbox delete -u ... "<name>" to delete.
Am 20.03.2015 um 21:18 schrieb Samuel Williams:
So, along with the problem of lots of folders ending in 1 1 1 1, I'd like to have a strategy to delete these.
I was trying to understand if it is possible to use http://linux.die.net/man/1/doveadm-expunge to delete empty folders, but without also deleting messages? Is this possible and if so what is the syntax?
Kind regards, Samuel
Thanks Hardy. I have 1600 folders to delete.. in the end I did find -type d -name "* 1" -exec rm -r {} \;
On 21 March 2015 at 21:22, Hardy Flor <HFlor@gmx.de> wrote:
With doveadm mailbox status -u ... messages"*" There is a list of folders and the number of messages and then with doveadm mailbox delete -u ... "<name>" to delete.
Am 20.03.2015 um 21:18 schrieb Samuel Williams:
So, along with the problem of lots of folders ending in 1 1 1 1, I'd like
to have a strategy to delete these.
I was trying to understand if it is possible to use http://linux.die.net/man/1/doveadm-expunge to delete empty folders, but without also deleting messages? Is this possible and if so what is the syntax?
Kind regards, Samuel
Hello Samuel,
with mdbox as Maildir no direct file operations should beperforms. For empty mailboxes that will ever happen, the "doveadm mailbox delete" deletes the emails, if required in the mailbox.
Hardy
Am 21.03.2015 um 11:48 schrieb Samuel Williams:
Thanks Hardy. I have 1600 folders to delete.. in the end I did find -type d -name "* 1" -exec rm -r {} \;
Hi Hardy, I had over 1600 folders, writing manually doveadm mailbox delete would be a real pain. I guess I could script it but that's even more of a pain. It would be nice if there was a command to remove empty mailboxes or something similar.
On 22 March 2015 at 07:50, Hardy Flor <HFlor@gmx.de> wrote:
Hello Samuel,
with mdbox as Maildir no direct file operations should beperforms. For empty mailboxes that will ever happen, the "doveadm mailbox delete" deletes the emails, if required in the mailbox.
Hardy
Am 21.03.2015 um 11:48 schrieb Samuel Williams:
Thanks Hardy. I have 1600 folders to delete.. in the end I did find -type d -name "* 1" -exec rm -r {} \;
Le 2015-04-01 01:16, Samuel Williams a écrit :
Hi Hardy, I had over 1600 folders, writing manually doveadm mailbox delete would be a real pain. I guess I could script it but that's even more of a pain. It would be nice if there was a command to remove empty mailboxes or something similar.
Hi Samuel,
you could do: find -type d -name "* 1" -exec rmdir {} \;
instead of rm -r, this will delete only really empty directories (no files, no hidden files).
Have a good day,
CHUNKZ.NET - dodgy DIYer and computer technician Bertrand Caplet, Flers (FR) Feel free to send encrypted/signed messages Key ID: FF395BD9 GPG FP: DE10 73FD 17EB 5544 A491 B385 1EDA 35DC FF39 5BD9
On Apr 1, 2015, at 2:15 AM, Bertrand Caplet <bertrand.caplet@chunkz.net> wrote:
Le 2015-04-01 01:16, Samuel Williams a écrit :
Hi Hardy, I had over 1600 folders, writing manually doveadm mailbox delete would be a real pain. I guess I could script it but that's even more of a pain. It would be nice if there was a command to remove empty mailboxes or something similar.
Hi Samuel,
you could do: find -type d -name "* 1" -exec rmdir {} \;
find /path/to/clean -type d -empty -delete
-- 'You don't think you've had enough, do you?' he said. I KNOW WHEN I'VE HAD ENOUGH. 'Everyone says that, though. I KNOW WHEN EVERYONE'S HAD ENOUGH. --Moving Pictures
An administrator should be able to write a small script from my first post in this thread (to the search of empty mailboxes and the command to delete), in order to not having to access the files.
Hardy
Am 01.04.2015 um 11:28 schrieb @lbutlr:
find /path/to/clean -type d -empty -delete
An administrator should be able to write a small script from my first post in this thread (to the search of empty mailboxes and the command to delete), in order to not having to access the files.
Hardy
I don't think there's any use of a script if "find /path/to/clean -type d -empty -delete" works fine.
Have a nice evening,
CHUNKZ.NET - dodgy DIYer and computer technician Bertrand Caplet, Flers (FR) Feel free to send encrypted/signed messages Key ID: 37F70C30 GPG FP: 134A 4027 518B 5F4D D409 558D BA9B 7BF0 37F7 0C30
On 21 Mar 2015, at 05:18, Samuel Williams <space.ship.traveller@gmail.com> wrote:
So, along with the problem of lots of folders ending in 1 1 1 1, I'd like to have a strategy to delete these.
I was trying to understand if it is possible to use http://linux.die.net/man/1/doveadm-expunge to delete empty folders, but without also deleting messages? Is this possible and if so what is the syntax?
-d Delete the mailbox if it is empty after expunging.
So create an expunge query that matches no messages:
doveadm expunge -d mailbox '*' not all
participants (5)
-
@lbutlr
-
Bertrand Caplet
-
Hardy Flor
-
Samuel Williams
-
Timo Sirainen