mbox and maildir check for new mail

how can i with python check mbox's and maildir's for new mail?
I'm just looking after how mbox and maildir says that a mail is read or not,
i don't need any code.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

A mail that is read, has in it's Status header a letter R.  So, for example the following mail is not read yet:

From:   Siamak
To:     "Behdad Esfahbod" <behdad>
Subject: "Eat The Document" in Toronto
Date:   Sun, 31 Oct 2004 21:29:43 -0500
Status: O

But this one is the same message, but read this time:

From:   Siamak
To:     "Behdad Esfahbod" <behdad>
Subject: "Eat The Document" in Toronto
Date:   Sun, 31 Oct 2004 21:29:43 -0500
Status: RO

Other flags may come and go in Status, but "R" is for read.  This is for mbox, but I believe the same method is used for maindir too.

Hope it helps.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
In case of Maildir, you can simply look into Maildir/new folder to see if there are any e-mail files here.
Each file represents one new e-mail.
Each e-mail is moved to Maildir/cur folder automatically when it's in status Read so you don't have to worry aboit it.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.