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

  • 2 years 2 days ago
  • 2 years 2 days ago
  • 2 years 4 days ago
    php 8.x
  • 2 years 6 days ago
    10.6.7
  • 2 years 1 week ago
    Drop Centos 5/6 stuff