Can I delete or move mail files from maildir cur folder?
Yes, you may delete files from that folder manually. Dovecot is designed to assume that other software besides itself might manipulate the Maildir folder, including adding, removing, and renaming (the portion of the filename after the colon). It will update the indices accordingly as soon as it notices.
In order to avoid deleting those mails outright, you could also use regular shell utilities (mv
, mkdir
, etc...) to:
- separate them into multiple smaller folders
- move them out to a temporary location and move them in again in smaller bunches of manageable size
- use a good IMAP client that synchronizes the folder contents without having to download everything. (unfortunately, good email clients are in short supply. They all suck. Some just suck less.
In contrast, you shouldn't try this if you are using Dovecot with dbox (either sdbox or mdbox). In that case, use doveadm
commands to manipulate the mailbox contents without using an email client.
You can use dovecot's own tools for that, e.g. doveadm move
. You can use search queries to select mails.
This selects all mails in a date range and moves them to the Archive
doveadm move -u jane Archive/2011/09 mailbox INBOX BEFORE 2011-10-01 SINCE 01-Sep-2011
To just search without action use the search command:
doveadm search -u jane mailbox INBOX BEFORE 2011-10-01 SINCE 01-Sep-2011