I am using mail
from GNU Mailutils to read the contents of a Maildir. For emails that have already been marked as read, is there a way to mark them as unread in mail
?
1 Answer
Update:
As of GNU Mailutils version 3.14 (released on 2022-01-02), GNU Mailutils implements the "unread" command. An email can be marked as unread by pressing U.
Old answer:
This feature is not mentioned in POSIX mailx
, and is not implemented by GNU Mailutils' mailx
. S-nail and the BSDs' mailx
support an unread
command to mark emails as unread. However, BSD implementations of mailx do not support the Maildir format, so the solution is to use S-nail, which supports the Maildir format. Alternatively, one could move away from mailx
and switch to using a simple email client such as Mutt.
mutt
(which I strongly recommend as a text-mode mail client). Usewn
to set the current message as New. Or tag a whole bunch of messages (e.g.T.<enter>
to tag all messages, orTfoo<enter>
to tag all messages matching "foo" orT ~M 1-50
to tag msgs 1-50. Read the docs - there are lots of tagging and searching options) and set them all as unread with;wn
.;
applies the next command to all tagged messages, instead of the current message.