How can i view mail using doveadm?

0

I have mail sent to my dovecot inbox and I can see that there are unread emails. If I run:

doveadm -f table mailbox status -u bob all INBOX

I get:

mailbox messages recent uidnext uidvalidity unseen highestmodseq vsize guid                             firstsaved
INBOX   2        2      3       1581074875  2      3             37815 26782a22bb493d5e3e070000fb112bbd 1581074773

How can i read these unread messages?

TheHairyDoughnut

Posted 2020-02-07T14:37:25.927

Reputation: 3

Answers

0

Normally you'd use an IMAP client to access mail, as Dovecot is an IMAP server...

mutt -f imap://bob@localhost/INBOX

As a trick, it is possible with some IMAP clients to talk directly to Dovecot, bypassing authentication:

mutt -e 'set tunnel="sudo doveadm exec imap -u bob"' -f imap://nothing/INBOX

But if you need to extract the messages directly, use doveadm fetch or doveadm search:

doveadm fetch -u bob "text" MAILBOX INBOX UNSEEN

Parameters are similar to IMAP – text is a fetch field that contains the entire RFC822 message, the rest are a search query that finds unread messages in the INBOX folder.

user1686

Posted 2020-02-07T14:37:25.927

Reputation: 283 655