doveadm

doveadm, the Dovecot administration utility, can be used to manage various parts of Dovecot. It can be very useful for performing complex searches of mailboxes as well as deleting or moving the messages it finds.

Search Examples
Find messages that user1@domain.com sent to user2@domain.com before 2011-01-01:

doveadm search -u user@domain.com mailbox Sent TO user2@domain.com SENTBEFORE 2011-01-01

Same query but display the physical size of the messages, along with the message filename:

doveadm fetch -u user@domain.com size.physical mailbox Sent TO user2@domain.com  SENTBEFORE 2011-01-01

Display just the physical size of the messages found:

doveadm -f tab fetch -u user@domain.com size.physical mailbox Sent TO user2@domain.com SENTBEFORE 2011-01-01

A little awk addition to total up the message sizes and display it in megabytes:

doveadm -f tab fetch -u user@domain.com size.physical mailbox Sent TO user2@domain.com SENTBEFORE 2011-01-01  | awk '{s+=$1} END {print s/1024/1024}'

Credits

Various bits of code, scripts, and procedures were put together with information from John Simpson's qmail.jms1.net website. It's an excellent resource on managing and setting up a Qmail server.

Recent Updates

  • PHP
    1 year 7 months ago
    PHP 7.4
  • 1 year 7 months ago
    MariaDB 10.4.12
  • 1 year 7 months ago
    Dovecot 2.3.10
  • 1 year 7 months ago
    CentOS 6 revisions
  • 1 year 7 months ago
    Copy of the revision from Wed, 08/22/2018 - 13:39.