http://www.perlmonks.org?node_id=482004


in reply to finding unread emails in IMAP maildir

Unread messages should be in the new subdirectory of Maildir, and read messages in cur. Not sure about using those modules, but that's how Maildir works. See http://cr.yp.to/proto/maildir.html.
  • Comment on Re: finding unread emails in IMAP maildir

Replies are listed 'Best First'.
Re^2: finding unread emails in IMAP maildir
by iguanodon (Priest) on Aug 09, 2005 at 01:21 UTC
    Unread messages should be in the new subdirectory of Maildir, and read messages in cur. Not sure about using those modules, but that's how Maildir works. See http://cr.yp.to/proto/maildir.html.
    That's basically correct but... at least with my Postfix / Courier IMAP / Squirrelmail setup, as soon as I use Squirrelmail any messages in the new dir are moved to cur - even if they're not read yet. When the message is read, :2,S is appended to the file name in cur. This is best explained at http://www.courier-mta.org/?maildir.html . Other MTA/IMAP server/MUA combinations may handle this differently.

Re^2: finding unread emails in IMAP maildir
by chrisj0 (Acolyte) on Aug 08, 2005 at 20:07 UTC
    Yes I know,
    I've tried giving Email::Folder just a subdirectory of the Maildir, but it errors out saying it's not a maildir.
      Ah. A clever hack might be to create a fake Maildir with a symlink to cur and an empty new and tmp to get the read messages, and a symlink to new and an empty cur and tmp to get the unread messages.

      But maybe the best solution is to modify Email::Folder::Maildir to include this information, perhaps by prepending a fake header saying where the message came from.