Let's have a program that checks an email mailbox and then "processes" the messages contained there. (For this question it doesn't really matter what it actually does with the message). The program will run once per hour and can easily handle the volume of new messages and there is no penalty for processing a message twice. Let's say it will be using the IMAP protocol and can perform any of the standard functions that an email application can do.

What mechanism would you recommend for processing the email?

  • Mark as read - the program marks a message as read after processing it.
  • Unmodified mailbox - the program doesn't modify the mailbox at all.
  • Something else - some other method I haven't thought of yet.

Suggestions welcome.

  • 2
    What is being done with the message is what really matters. Is it scanning for coupons sent to a user? Then leave the message along. Is it processing a helpdesk queue? Then mark the message as read. Is it downloading files sent to the mailbox? Then delete the mail after processing. – Mike May 1 '13 at 18:31
  • Each message is converted to an alternate format and imported into another system. – dustmachine May 1 '13 at 18:35
  • Why have you chosen polling instead of "at once" processing? – AnFi May 2 '13 at 14:22
  • More email could arrive hourly/daily/whenever. – dustmachine May 4 '13 at 5:05

The best option will depend on what else you plan to do with the mailbox. If the answer is "nothing" then you should have your program delete mails from the mailbox. If the answer is "something" then your program should modify the mailbox in a way that plays nicely with the other clients that will be accessing the mailbox.

  • Delete the mail
  • Mark as read
  • Move to a folder
  • Apply an IMAP keyword

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.