Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

One of my users had some sort of debug output mailed to a address on my server..

Something "went wrong" and now I have 35000 mails in a inbox. I need to delete those mails, they are all from 1 specific address. The rest of the inbo needs to stay untouched.

How do I achieve this?

Platform: CentOS 5 with DirectAdmin, Dovecot, Exim.

share|improve this question

closed as off-topic by HopelessN00b Apr 3 '15 at 18:13

  • This question does not appear to be about server, networking, or related infrastructure administration within the scope defined in the help center.
If this question can be reworded to fit the rules in the help center, please edit the question.

I might not be able to post a full answer, but do take a look at: – Jodie C Jul 12 '12 at 2:05
up vote 2 down vote accepted

Dovecot v.2 has an utility called doveadm that allow number of functions.


doveadm expunge -u savedbefore 2w

delete all messages that older than two weeks from jane.doe's mailbox.

If you have dovecot v.1 you have to use system utility find:

find -E $userdir \
     -type f \
     -iregex ".*(cur|new).*" \
     ! -newerBt "1 month ago" \
     -exec rm {} \;
share|improve this answer
Thanks but how to delete all email that is received from one specific email address? – edwardmp Jul 12 '12 at 9:32
Managed to do it like this: doveadm expunge -u mailbox Inbox FROM – edwardmp Jul 12 '12 at 17:27

If you are familiar with python just write a quick script using the poplib

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.