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?
1 Answer
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.