docker compose -f /opt/mailcow-dockerized/docker-compose.yml exec dovecot-mailcow doveadm search -u user@example.com mailbox INBOX subject 'invoice'

Category: Mail Servers & Postfix

docker compose -f /opt/mailcow-dockerized/docker-compose.yml exec dovecot-mailcow doveadm search -u user@example.com mailbox INBOX subject 'invoice'

Find messages matching a search in a mailbox

doveadm search prints the UIDs of messages matching the given search, here unread subject lines in INBOX. It runs the same search engine as IMAP SEARCH. Follow up with doveadm fetch to read the raw message of a found UID.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.