OK, perhaps I tried to cover too much, so let's just look at this: If I run this command, I get no errors:
doveadm expunge -u kremels MAILBOX-GUID 1488800748.47633_1.mail.covisp.net UID 22908 But, if I search again doveadm -f table fetch -u kremels 'hdr.message-id guid uid hdr.x-listname' mailbox 'Archive' | sort| awk 'cnt[$1]++{if (cnt[$1]==2) print prev[$1]; print} {prev[$1]=$0}' |grep -E "[0-9] +$" |awk '{print "doveadm expunge -u kremels MAILBOX-GUID "$2" UID "$3}' | grep 22908 hdr.message-id guid uid hdr.x-listname doveadm expunge -u kremels MAILBOX-GUID 1488800748.47633_1.mail.covisp.net UID 22908 The message is still listed. Am i misunderstanding something about how expunge works or what it does? How do i remove the messages in such a way that they will not show up in subsequent searches (as far as I can tell, assuming the 1488800748.47633_1 is the first part of the file name in the maildir, the message is actually deleted). $ find Maildir -name "1488800*" Maildir/.Archive/cur/1488800350.46962_1.mail.covisp.net:2,S Maildir/.Archive/cur/1488800633.47337_1.mail.covisp.net:2,S Maildir/.Sent/cur/1488800118.M2833P43167.mail.covisp.net,S=1221,W=1251:2,Sad -- Tragic heroes always moan when the gods take an interest in them, but it's the people the gods ignore who get the really tough deals. --Mort