Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Preview email with CFIMAP without marking the SEEN flag?

On ColdFusion 9 we are attempting to use CFIMAP to get a preview (subject, from, date) of the users email messages. We can get the data out with getHeaderOnly but doing so sets the SEEN flag as yes.

Is there a way to use CFIMAP to get a preview without marking it as SEEN?

Is this a normal feature of IMAP in general?

like image 616
Tom Hubbard Avatar asked Jan 13 '14 21:01

Tom Hubbard


1 Answers

We might as well get this question answered. As @HenryGibson pointed out, this is not possible with <cfimap>: it does not expose the relevant functionality. See the PEEK note on FETCH in the RFC: "6.4.5. FETCH Command". That's what you need to be able to do, and you have no control over that stuff with <cfimap>

However Java has a library for access mail stores via IMAP: IMAPStore; and looking at the docs for IMAPMessage it (unsurprisingly) supports the PEEK option on a fetch: setPeek().

So it'll definitely be doable. It's a shame <cfimap> doesn't make this simple for you though: it might be worth raising an E/R for it on the bugbase.

I think you need to give it a bash with Java, and if you run into issues, then raise a question here relevant to that. I've not personally taken the java route, so can't give you a quick "101" on it, and it's not sufficiently trivial as to really be a fit for an answer here (and I have to concede I don't have motivation to get up to speed with it enough to do so).

But <cfimap> will not be part of your solution to this, I'm afraid.

like image 110
Adam Cameron Avatar answered Oct 07 '22 16:10

Adam Cameron