librelist archives

« back to archive

POP fetch only gives fresh results after relaunch?

POP fetch only gives fresh results after relaunch?

From:
David Hearst
Date:
2014-01-20 @ 21:31
Hi,

I’ve been trying to use the MailCore2 POP support in an in-house utility 
app we’re developing. I’ve been trying to refresh the message list every 
30 seconds but have found that now matter how many times I fetch message 
info, I always get the state of the POP account that existed when I first 
launched the app and set up the POP session. If I quit my app and 
relaunch, then I get current results.

In a nutshell, this is what I do:

1) Launch my app - this creates the POP session, connects with credentials
and fetches the messages once
2) in -didFetchMessages, I update the UI if anything has changed
3) Start a timer that fires every 30 seconds, triggering a method that 
re-fetches the messages
4) Send a new message to the POP account and verify that multiple 
independent clients see the new message post
5) No matter how long I wait in my app, I never see the new message appear
via the MailCore POP fetch (unless I quit and relaunch)

The fetches fire every 30 seconds, but the messages are always the same, 
even though other clients see the additional message.

Do I have to disconnect and reconnect the session to see the updated 
message list? Is there something else I need to do to convince the session
that I want new results?

Thanks, David

Re: [mailcore] POP fetch only gives fresh results after relaunch?

From:
Hoa V. Dinh
Date:
2014-01-20 @ 21:34
POP is a (very) disconnected protocol.  
Then, when you are checking for new emails, you have to:
- connect to the server
- grab the emails you want
- delete the emails that you successfully download (and keep track of them
so you don’t download them again)
- disconnect from the server

All the servers won’t change their state until you disconnect and reconnect.  

--  
Hoa V. DINH


On Monday, January 20, 2014 at 1:31 PM, David Hearst wrote:

> Hi,
>  
> I’ve been trying to use the MailCore2 POP support in an in-house utility
app we’re developing. I’ve been trying to refresh the message list every 
30 seconds but have found that now matter how many times I fetch message 
info, I always get the state of the POP account that existed when I first 
launched the app and set up the POP session. If I quit my app and 
relaunch, then I get current results.
>  
> In a nutshell, this is what I do:
>  
> 1) Launch my app - this creates the POP session, connects with 
credentials and fetches the messages once
> 2) in -didFetchMessages, I update the UI if anything has changed
> 3) Start a timer that fires every 30 seconds, triggering a method that 
re-fetches the messages
> 4) Send a new message to the POP account and verify that multiple 
independent clients see the new message post
> 5) No matter how long I wait in my app, I never see the new message 
appear via the MailCore POP fetch (unless I quit and relaunch)
>  
> The fetches fire every 30 seconds, but the messages are always the same,
even though other clients see the additional message.
>  
> Do I have to disconnect and reconnect the session to see the updated 
message list? Is there something else I need to do to convince the session
that I want new results?
>  
> Thanks, David  
>  
>  
> Attachments:  
> - smime.p7s
>  

Re: [mailcore] POP fetch only gives fresh results after relaunch?

From:
David Hearst
Date:
2014-01-20 @ 22:11
could not decode message

Re: [mailcore] POP fetch only gives fresh results after relaunch?

From:
Hoa V. Dinh
Date:
2014-01-20 @ 23:11
delete also remove them from the server. I’m not sure how much it would 
scale if you don’t remove the messages from the server.  

It looks like IMAP would better fit your needs though.  

--  
Hoa V. DINH


On Monday, January 20, 2014 at 2:11 PM, David Hearst wrote:

> In this case, we don’t want to delete any messages from the server, we 
want them to persist and be viewable from multiple instances of the 
client.
>  
> Does "delete the emails that you successfully download” mean deleting 
them from the server, or does that only apply to the local session?
>  
> Basically, our client needs to:
>  
> - Fetch all messages from the server
> - Filter those messages and display the filtered results
> - Fetch periodically in case additional messages have arrived, then 
re-filter and display
>  
> The only place where deletes would happen is in testing, I periodically 
remove test messages using an external client. Our app will not have the 
ability to send or edit messages.< div>
> Thanks, David
>  
>  
> On Jan 20, 2014, at 2:34 PM, Hoa V. DINH <dinh.viet.hoa@gmail.com 
(mailto:dinh.viet.hoa@gmail.com)> wrote:
> > POP is a (very) disconnected protocol.  
> > Then, when you are checking for new emails, you have to:
> > - connect to the server
> > - grab the emails you want
> > - delete the emails that you successfully download (and keep track of 
them so you don’t download them again)
> > - disconnect from the server
> >  
> > All the servers won’t change their state until you disconnect and reconnect.  
> >  
> > --  
> > Hoa V. DINH
> >  
> >  
> > On Monday, January 20, 2014 at 1:31 PM, David Hearst wrote:
> >  
> > > Hi,
> > >  
> > > I’ve been trying to use the MailCore2 POP support in an in-house 
utility app we’re developing. I’ve been trying to refresh the message list
every 30 seconds but have found that now matter how many times I fetch 
message info, I always get the state of the POP account that existed when 
I first launched the app and set up the POP session. If I quit my app and 
relaunch, then I get current results.
> > >  
> > > In a nutshell, this is what I do:
> > >  
> > > 1) Launch my app - this creates the POP session, connects with 
credentials and fetches the messages once
> > > 2) in -didFetchMessages, I update the UI if anything has changed
> > > 3) Start a timer that fires every 30 seconds, triggering a method 
that re-fetches the messages
> > > 4) Send a new message to the POP account and verify that multiple 
independent clients see the new message post
> > > 5) No matter how long I w ait in my app, I never see the new message
appear via the MailCore POP fetch (unless I quit and relaunch)
> > >  
> > > The fetches fire every 30 seconds, but the messages are always the 
same, even though other clients see the additional message.
> > >  
> > > Do I have to disconnect and reconnect the session to see the updated
message list? Is there something else I need to do to convince the session
that I want new results?
> > >  
> > > Thanks, David  
> > >  
> > >  
> > > Attachments:  
> > > - smime.p7s
> > >  
> > >  
> >  
> >  
>  
>  
> Attachments:  
> - smime.p7s
>