[Dovecot] delete message with specified id
Good day, everyone!
Could someone help me to find a way to delete message with certain id from all users's mailboxes?
What seems to be a problem:
I have configured exim + dovecot lmtp
I got a long list of aliases in BD in form of: +----------+-------------------------------------+ |alias_name recipients | (for example) -----------|-------------------------------------+ | list_a | user1@example.org,user2@example.org | +----------|-------------------------------------+
When I send a message to that list_a, user1 and user2 get the mail and I see this in log: Dec 6 12:12:27 beta-mail dovecot: lmtp(16419, user1@example.org): copy from INBOX: box=INBOX, uid=1, msgid=E1VojxY-0004Gl-Gu@beta-mail, size=570 Dec 6 12:12:27 beta-mail dovecot: lmtp(16419, user1@example.org): oCOXKmAkoVIjQAAA635u4w: msgid=E1VojxY-0004Gl-Gu@beta-mail: from=root@beta-mail: subj=: saved mail to INBOX Dec 6 12:12:27 beta-mail dovecot: lmtp(16419, user2@example.org): copy from INBOX: box=INBOX, uid=1, msgid=E1VojxY-0004Gl-Gu@beta-mail, size=570 Dec 6 12:12:27 beta-mail dovecot: lmtp(16419, user2@example.org): oCOXKmAkoVIjQAAA635u4w: msgid=E1VojxY-0004Gl-Gu@beta-mail: from=root@beta-mail: subj=: saved mail to INBOX
Is it possible to delete these letters with known msgid=E1VojxY-0004Gl-Gu@beta-mail from all users mailboxes with couple of simple commands ?
How do I do it currently:
in exim's log I get mailaddress of a user, get into his mailbox (wich cd), find the letter I need, with ls -i I get inode, search (with find) through all users mails and delete all files with that inode, then I have to rebuild dovecot indexes with doveadm mailbox status -A -t all INBOX
-- С уважением, Костырев Александр администратор Linux-систем
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Fri, 6 Dec 2013, Костырев Александр Алексеевич wrote:
Could someone help me to find a way to delete message with certain id from all users's mailboxes?
I think, this should do it [test, before killing your users messages ;-) ]:
doveadm [-Dv] expunge [-S socket_path] [-d] -u user HEADER Message-ID '<msgid>'
http://wiki2.dovecot.org/Tools/Doveadm/Expunge
doveadm-expunge - Expunge messages matching given search query
To see the messages and performance:
http://wiki2.dovecot.org/Tools/Doveadm/Search
doveadm-search - Show a list of mailbox GUIDs and message UIDs matching given search query.
same command line, but "search" instead of "expunge"
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux)
iQEVAwUBUqF/mF3r2wJMiz2NAQJLKAgAjha9mfT+MWHnzIZ6PiJSwMqeSoe8DNZb FhXxt7gEqe1eEojBFOUkM17FdqwIjZ4PXHRook3vxSfBx0TtQ8xEkNMkyUKsjmLS Q51GjbwmOX964Xo4zSmo5R9b1bpyBW3jDfbYYMXXf1gLEFu82CPlIq+TL1IQAyrY YKr7ZXYM3Wy1sGpf6csF9WhMWUmj4XmQkgeoSTvlNQ0FL1EL7S4dhyrJCi5s1hcp XA6jHD2BchRdFxK02ikkYtPgDMDDduSl9wzxAJl5Ed4FG74nvf622DOYmPh+VbUt sYxLTfEVhFvNqkyuQhzarHlnzeFG4//R4+g0190j66C7O8QDGQWYcA== =gxly -----END PGP SIGNATURE-----
that's it! thanks a lot!
-- С уважением, Костырев Александр администратор Linux-систем
-----Original Message----- From: dovecot-bounces@dovecot.org [mailto:dovecot-bounces@dovecot.org] On Behalf Of Steffen Kaiser Sent: Friday, December 06, 2013 6:41 PM To: Костырев Александр Алексеевич Cc: dovecot@dovecot.org Subject: Re: [Dovecot] delete message with specified id
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Fri, 6 Dec 2013, Костырев Александр Алексеевич wrote:
Could someone help me to find a way to delete message with certain id from all users's mailboxes?
I think, this should do it [test, before killing your users messages ;-) ]:
doveadm [-Dv] expunge [-S socket_path] [-d] -u user HEADER Message-ID '<msgid>'
http://wiki2.dovecot.org/Tools/Doveadm/Expunge
doveadm-expunge - Expunge messages matching given search query
To see the messages and performance:
http://wiki2.dovecot.org/Tools/Doveadm/Search
doveadm-search - Show a list of mailbox GUIDs and message UIDs matching given search query.
same command line, but "search" instead of "expunge"
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux)
iQEVAwUBUqF/mF3r2wJMiz2NAQJLKAgAjha9mfT+MWHnzIZ6PiJSwMqeSoe8DNZb FhXxt7gEqe1eEojBFOUkM17FdqwIjZ4PXHRook3vxSfBx0TtQ8xEkNMkyUKsjmLS Q51GjbwmOX964Xo4zSmo5R9b1bpyBW3jDfbYYMXXf1gLEFu82CPlIq+TL1IQAyrY YKr7ZXYM3Wy1sGpf6csF9WhMWUmj4XmQkgeoSTvlNQ0FL1EL7S4dhyrJCi5s1hcp XA6jHD2BchRdFxK02ikkYtPgDMDDduSl9wzxAJl5Ed4FG74nvf622DOYmPh+VbUt sYxLTfEVhFvNqkyuQhzarHlnzeFG4//R4+g0190j66C7O8QDGQWYcA== =gxly -----END PGP SIGNATURE-----
participants (2)
-
Steffen Kaiser
-
Костырев Александр Алексеевич