views:

416

answers:

5

Right now its a gmail box but sooner or later I want it to scale.

I want to sync a copy of a live personal mailbox (inbox and outbox) somewhere else, but I don't want to affect the unread state of any unread messages.

what type of access will make this easiest? I can't find any information if IMAP will affect the read state, but it appears I can manually reset a message to unread. Pop by definition doesn't affect unread state but nobody seems to use pop to access their gmail, why?

+2  A: 

Nobody uses POP because typically they want the extra functionality of IMAP, such as tracking message state. When that functionality is only getting in your way and needs workarounds, I think using POP's your best bet!-)

Alex Martelli
+2  A: 

Hi,

In the IMAP world, each message has flags. You can set the individual flags on each message. When you Fetch a message, it's actually possible to read the message, without applying the \Seen flag.

Most mail clients will apply the \Seen flag when the message is read. So, if the message has already been read, outside of your app, then you will need to remove the \Seen flag.

Just as fyi...here is the relevant part about flags from the RFCs:

A system flag is a flag name that is pre-defined in this specification. All system flags begin with "\". Certain system flags (\Deleted and \Seen) have special semantics described elsewhere. The currently-defined system flags are:

    \Seen
       Message has been read

    \Answered
       Message has been answered

    \Flagged
       Message is "flagged" for urgent/special attention

    \Deleted
       Message is "deleted" for removal by later EXPUNGE

    \Draft
       Message has not completed composition (marked as a draft).

    \Recent
       Message is "recently" arrived in this mailbox.  This session
       is the first session to have been notified about this
       message; if the session is read-write, subsequent sessions
       will not see \Recent set for this message.  This flag can not
       be altered by the client.

       If it is not possible to determine whether or not this
       session is the first session to be notified about a message,
       then that message SHOULD be considered recent.

       If multiple connections have the same mailbox selected
       simultaneously, it is undefined which of these connections
       will see newly-arrived messages with \Recent set and which
       will see it without \Recent set.

Cheers!

Dave

dave wanta
+1  A: 

There is a .PEEK option on the FETCH command in IMAP that will explicitly not set the /Seen flag.

Look at the FETCH command in RFC 3501 and scroll down a bit to page 57 or search for "BODY.PEEK".

Dan Goldstein
A: 

if it helps anyone, GAE allows you to receive email as an HTTP request, so for now i'm just forwarding emails there.

Dustin Getz
A: 

I am processing with email like that..first i am reading particular email with UID then fetch that email has flag unread , as soon as i fetch email that email having flag "UNSEEN" is now change to "Seen" right?

I know we can fetch email without touching flags of email but i want to read it and first let it be set flag to "Seen", it can be done by examine folder.

Now i want to set flag of email as "UNSEEN" that recently i have fetch, so my question is that can i command to server to set flag email as "UNSEEN"?
so can we do that ? please reply me how can i do this ? any suggestion or any help ? email me on [email protected]

jay
If you want to ask a question, don't put it in an answerbut start a new thread for it.The "Ask Question" button is in the top right of this page.More people would see your question and try to answer that way.
sth