librelist archives

« back to archive

fetch only unread messages

fetch only unread messages

From:
Tom Lieber
Date:
2013-03-04 @ 23:12
Is there a way to download the envelopes of only the unread messages in a
folder?

-- 
Tom Lieber
http://AllTom.com/
http://infinite-sketchpad.com/

Re: [mailcore] fetch only unread messages

From:
Matt Ronge
Date:
2013-03-05 @ 02:22
Hi!

It would be possible using an IMAP search but that isn't exposed by 
MailCore right now :(

You could dive into the C library beneath MailCore which is LibEtPan. 
LibEtPan does support IMAP search, just there is no Obj-C wrapper for it 
right now.

What are you trying to accomplish, maybe there is another method that can 
do close to what you want?
--
Matt Ronge

iOS App Consultant
Central Atomics Inc.
http://www.centralatomics.com







On Mar 4, 2013, at 5:12 PM, Tom Lieber <tom@alltom.com> wrote:

> Is there a way to download the envelopes of only the unread messages in 
a folder?
> 
> -- 
> Tom Lieber
> http://AllTom.com/
> http://infinite-sketchpad.com/

Re: [mailcore] fetch only unread messages

From:
Tom Lieber
Date:
2013-03-06 @ 02:23
I'm working on an OS X app that downloads unread messages in
[Gmail]/Important, saves them locally, then marks them as read. I have tens
of thousands of messages marked as important, so I'm currently hard-coding
the starting sequence number as 39800. :)

I've dived into the MailCore and libetpan source a few times to hack in
X-GM-THRID <https://github.com/alltom/libetpan/commits/master> and OAuth2
authentication <https://github.com/alltom/libetpan/commits/xoauth2> (based
on waseems's work on an earlier
fork<https://github.com/waseems/MailCore/commits/master/libetpan>),
so I might have some luck getting a search for unread messages working with
some advice. Lacking a high-level overview of libetpan, and not knowing
much about the IMAP protocol, has made reading and modifying libetpan very
unpleasant, though.


On Mon, Mar 4, 2013 at 9:22 PM, Matt Ronge <mronge@mronge.com> wrote:

> Hi!
>
> It would be possible using an IMAP search but that isn't exposed by
> MailCore right now :(
>
> You could dive into the C library beneath MailCore which is LibEtPan.
> LibEtPan does support IMAP search, just there is no Obj-C wrapper for it
> right now.
>
> What are you trying to accomplish, maybe there is another method that can
> do close to what you want?
> --
> Matt Ronge
>
> iOS App Consultant
> Central Atomics Inc.
> http://www.centralatomics.com
>
>
>
>
>
>
>
> On Mar 4, 2013, at 5:12 PM, Tom Lieber <tom@alltom.com> wrote:
>
> > Is there a way to download the envelopes of only the unread messages in
> a folder?
> >
> > --
> > Tom Lieber
> > http://AllTom.com/
> > http://infinite-sketchpad.com/
>
>


-- 
Tom Lieber
http://AllTom.com/
http://infinite-sketchpad.com/

Re: [mailcore] fetch only unread messages

From:
Matt Ronge
Date:
2013-03-14 @ 21:23
Here is somebody's fork that has exactly what you are looking for, search 
for unread messages: 
https://github.com/jdg/MailCore/commit/1a13ba79a4bde714ee3ed31802254ec193c3c77f
--
Matt Ronge

iOS App Consultant
Central Atomics Inc.
http://www.centralatomics.com







On Mar 5, 2013, at 8:23 PM, Tom Lieber <tom@alltom.com> wrote:

> I'm working on an OS X app that downloads unread messages in 
[Gmail]/Important, saves them locally, then marks them as read. I have 
tens of thousands of messages marked as important, so I'm currently 
hard-coding the starting sequence number as 39800. :)
> 
> I've dived into the MailCore and libetpan source a few times to hack in 
X-GM-THRID and OAuth2 authentication (based on waseems's work on an 
earlier fork), so I might have some luck getting a search for unread 
messages working with some advice. Lacking a high-level overview of 
libetpan, and not knowing much about the IMAP protocol, has made reading 
and modifying libetpan very unpleasant, though.
> 
> 
> On Mon, Mar 4, 2013 at 9:22 PM, Matt Ronge <mronge@mronge.com> wrote:
> Hi!
> 
> It would be possible using an IMAP search but that isn't exposed by 
MailCore right now :(
> 
> You could dive into the C library beneath MailCore which is LibEtPan. 
LibEtPan does support IMAP search, just there is no Obj-C wrapper for it 
right now.
> 
> What are you trying to accomplish, maybe there is another method that 
can do close to what you want?
> --
> Matt Ronge
> 
> iOS App Consultant
> Central Atomics Inc.
> http://www.centralatomics.com
> 
> 
> 
> 
> 
> 
> 
> On Mar 4, 2013, at 5:12 PM, Tom Lieber <tom@alltom.com> wrote:
> 
> > Is there a way to download the envelopes of only the unread messages 
in a folder?
> >
> > --
> > Tom Lieber
> > http://AllTom.com/
> > http://infinite-sketchpad.com/
> 
> 
> 
> 
> -- 
> Tom Lieber
> http://AllTom.com/
> http://infinite-sketchpad.com/

Re: [mailcore] fetch only unread messages

From:
Tom Lieber
Date:
2013-03-15 @ 03:28
Thanks for hunting that down! It didn't actually work until the following

commit<https://github.com/jdg/MailCore/commit/7e3cac321185eedec5fd1e2ef6bb48b2f59f0cba>,
but that wasn't hard to track down. I also had to make it attempt to open a
connection before performing searches. The version I'm using is in my
branch now:
https://github.com/alltom/MailCore/commit/b9759d3fab6ced853f8b03254d516d81d4bcf897

I could send pull requests for all the patches I've been collecting there,
but I don't understand MailCore and libetpan well enough to make non-evil
changes yet. For example, OAuth2 works by commenting out the lines that
send the password and adding a few other tokens (that's how it was when I
found it). I tried tracing the login call upward through the call graph to
find a good place to branch the control flow for the two auth schemes, but
I couldn't find a place that seemed appropriate.

I'd love to help get these features in, though. What if I opened pull
requests for what I have so that we can discuss them individually on GitHub?

Davide's branch seems to have a more developed implementation of X-GM-THRID
support, and perhaps some other features as well. I'll have to review that
too.


On Thu, Mar 14, 2013 at 5:23 PM, Matt Ronge <mronge@mronge.com> wrote:

> Here is somebody's fork that has exactly what you are looking for, search
> for unread messages:
> https://github.com/jdg/MailCore/commit/1a13ba79a4bde714ee3ed31802254ec193c3c77f
> --
> Matt Ronge
>
> iOS App Consultant
> Central Atomics Inc.
> http://www.centralatomics.com
>
>
>
>
>
>
>
> On Mar 5, 2013, at 8:23 PM, Tom Lieber <tom@alltom.com> wrote:
>
> > I'm working on an OS X app that downloads unread messages in
> [Gmail]/Important, saves them locally, then marks them as read. I have tens
> of thousands of messages marked as important, so I'm currently hard-coding
> the starting sequence number as 39800. :)
> >
> > I've dived into the MailCore and libetpan source a few times to hack in
> X-GM-THRID and OAuth2 authentication (based on waseems's work on an earlier
> fork), so I might have some luck getting a search for unread messages
> working with some advice. Lacking a high-level overview of libetpan, and
> not knowing much about the IMAP protocol, has made reading and modifying
> libetpan very unpleasant, though.
> >
> >
> > On Mon, Mar 4, 2013 at 9:22 PM, Matt Ronge <mronge@mronge.com> wrote:
> > Hi!
> >
> > It would be possible using an IMAP search but that isn't exposed by
> MailCore right now :(
> >
> > You could dive into the C library beneath MailCore which is LibEtPan.
> LibEtPan does support IMAP search, just there is no Obj-C wrapper for it
> right now.
> >
> > What are you trying to accomplish, maybe there is another method that
> can do close to what you want?
> > --
> > Matt Ronge
> >
> > iOS App Consultant
> > Central Atomics Inc.
> > http://www.centralatomics.com
> >
> >
> >
> >
> >
> >
> >
> > On Mar 4, 2013, at 5:12 PM, Tom Lieber <tom@alltom.com> wrote:
> >
> > > Is there a way to download the envelopes of only the unread messages
> in a folder?
> > >
> > > --
> > > Tom Lieber
> > > http://AllTom.com/
> > > http://infinite-sketchpad.com/
> >
> >
> >
> >
> > --
> > Tom Lieber
> > http://AllTom.com/
> > http://infinite-sketchpad.com/
>
>


-- 
Tom Lieber
http://AllTom.com/
http://infinite-sketchpad.com/

Re: [mailcore] fetch only unread messages

From:
Matt Ronge
Date:
2013-03-26 @ 01:22

On Mar 14, 2013, at 10:28 PM, Tom Lieber <tom@alltom.com> wrote:

> I could send pull requests for all the patches I've been collecting 
there, but I don't understand MailCore and libetpan well enough to make 
non-evil changes yet. For example, OAuth2 works by commenting out the 
lines that send the password and adding a few other tokens (that's how it 
was when I found it). I tried tracing the login call upward through the 
call graph to find a good place to branch the control flow for the two 
auth schemes, but I couldn't find a place that seemed appropriate.

That'd be great. I could comment on any pull requests you open.

--
Matt Ronge

iOS App Consultant
Central Atomics Inc.
http://www.centralatomics.com


Re: [mailcore] fetch only unread messages

From:
Matt Ronge
Date:
2013-03-14 @ 20:31
If you are going to be hacking on LibEtPan I highly recommend you read the
RFC on IMAP: http://tools.ietf.org/html/rfc3501 It makes more of the code 
understandable.

I'd love pull requests for any of those things you've put in, like OAuth2 
or X-GM-THRID. That'd be amazing.

For now without search, you could download all the message envelopes from 
the server and just go through them looking for unread messages. It won't 
be as fast as the SEARCH command but it won't be drastically slower 
either.
--
Matt Ronge

iOS App Consultant
Central Atomics Inc.
http://www.centralatomics.com







On Mar 5, 2013, at 8:23 PM, Tom Lieber <tom@alltom.com> wrote:

> I'm working on an OS X app that downloads unread messages in 
[Gmail]/Important, saves them locally, then marks them as read. I have 
tens of thousands of messages marked as important, so I'm currently 
hard-coding the starting sequence number as 39800. :)
> 
> I've dived into the MailCore and libetpan source a few times to hack in 
X-GM-THRID and OAuth2 authentication (based on waseems's work on an 
earlier fork), so I might have some luck getting a search for unread 
messages working with some advice. Lacking a high-level overview of 
libetpan, and not knowing much about the IMAP protocol, has made reading 
and modifying libetpan very unpleasant, though.
> 
> 
> On Mon, Mar 4, 2013 at 9:22 PM, Matt Ronge <mronge@mronge.com> wrote:
> Hi!
> 
> It would be possible using an IMAP search but that isn't exposed by 
MailCore right now :(
> 
> You could dive into the C library beneath MailCore which is LibEtPan. 
LibEtPan does support IMAP search, just there is no Obj-C wrapper for it 
right now.
> 
> What are you trying to accomplish, maybe there is another method that 
can do close to what you want?
> --
> Matt Ronge
> 
> iOS App Consultant
> Central Atomics Inc.
> http://www.centralatomics.com
> 
> 
> 
> 
> 
> 
> 
> On Mar 4, 2013, at 5:12 PM, Tom Lieber <tom@alltom.com> wrote:
> 
> > Is there a way to download the envelopes of only the unread messages 
in a folder?
> >
> > --
> > Tom Lieber
> > http://AllTom.com/
> > http://infinite-sketchpad.com/
> 
> 
> 
> 
> -- 
> Tom Lieber
> http://AllTom.com/
> http://infinite-sketchpad.com/

Re: [mailcore] fetch only unread messages

From:
Davide Gullo
Date:
2013-03-14 @ 21:18
Hi,
take a look even on my fork of MailCore <https://github.com/Jazzo/MailCore>,
based on the fork of jdg <https://github.com/jdg/MailCore> as well as
Libetpan <https://github.com/Jazzo/libetpan>.
It implements X-GM-THRID and some fixs.





2013/3/14 Matt Ronge <mronge@mronge.com>

> If you are going to be hacking on LibEtPan I highly recommend you read the
> RFC on IMAP: http://tools.ietf.org/html/rfc3501 It makes more of the code
> understandable.
>
> I'd love pull requests for any of those things you've put in, like OAuth2
> or X-GM-THRID. That'd be amazing.
>
> For now without search, you could download all the message envelopes from
> the server and just go through them looking for unread messages. It won't
> be as fast as the SEARCH command but it won't be drastically slower either.
> --
> Matt Ronge
>
> iOS App Consultant
> Central Atomics Inc.
> http://www.centralatomics.com
>
>
>
>
>
>
>
> On Mar 5, 2013, at 8:23 PM, Tom Lieber <tom@alltom.com> wrote:
>
> > I'm working on an OS X app that downloads unread messages in
> [Gmail]/Important, saves them locally, then marks them as read. I have tens
> of thousands of messages marked as important, so I'm currently hard-coding
> the starting sequence number as 39800. :)
> >
> > I've dived into the MailCore and libetpan source a few times to hack in
> X-GM-THRID and OAuth2 authentication (based on waseems's work on an earlier
> fork), so I might have some luck getting a search for unread messages
> working with some advice. Lacking a high-level overview of libetpan, and
> not knowing much about the IMAP protocol, has made reading and modifying
> libetpan very unpleasant, though.
> >
> >
> > On Mon, Mar 4, 2013 at 9:22 PM, Matt Ronge <mronge@mronge.com> wrote:
> > Hi!
> >
> > It would be possible using an IMAP search but that isn't exposed by
> MailCore right now :(
> >
> > You could dive into the C library beneath MailCore which is LibEtPan.
> LibEtPan does support IMAP search, just there is no Obj-C wrapper for it
> right now.
> >
> > What are you trying to accomplish, maybe there is another method that
> can do close to what you want?
> > --
> > Matt Ronge
> >
> > iOS App Consultant
> > Central Atomics Inc.
> > http://www.centralatomics.com
> >
> >
> >
> >
> >
> >
> >
> > On Mar 4, 2013, at 5:12 PM, Tom Lieber <tom@alltom.com> wrote:
> >
> > > Is there a way to download the envelopes of only the unread messages
> in a folder?
> > >
> > > --
> > > Tom Lieber
> > > http://AllTom.com/
> > > http://infinite-sketchpad.com/
> >
> >
> >
> >
> > --
> > Tom Lieber
> > http://AllTom.com/
> > http://infinite-sketchpad.com/
>
>


-- 
Davide Gullo, Consulente Web
http://www.m4ss.net
gullo@m4ss.net