IMAP IDLE and synchronization

View: New views
4 Messages — Rating Filter:   Alert me  

IMAP IDLE and synchronization

by Wolfgang Beikircher :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey guys!

I'm trying to realize a synchronization application which keeps in sync
2 different mail server. Actually, I saw that javaMail supports the IDLE
command to get notified by the server if there are some changes.
Unfortuantely, the IDLE command is on a per-folder basis and blocks the
actual Thread. Therefore, if I want to use it, I would have to create a
thread for each folder. This solution has not really a good
performance.

I'm questioning myself now, if I'm using the command in the correct way.
Could you maybe help me? Are there other solutions?

By the way, I would also be notified if, for example, the flags change.
Therefore, a polling mechanism is not really the solution.

thanks for helping.

===========================================================================
To unsubscribe, send email to listserv@... and include in the body
of the message "signoff JAVAMAIL-INTEREST".  For general help, send email to
listserv@... and include in the body of the message "help".

Re: IMAP IDLE and synchronization

by Ronald Klop :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Why?

I don't know how much access you have to the servers. But it is probably more easy to do a backup-restore. Or rsync all the data periodicly.
Or use existing software http://www.google.com/search?q=imapsync .

Ronald.

Op donderdag, 29 januari 2009 om 14:03 uur schreef Wolfgang Beikircher <wolfgang.beikircher@...>:

 
Hey guys!

I'm trying to realize a synchronization application which keeps in sync
2 different mail server. Actually, I saw that javaMail supports the IDLE
command to get notified by the server if there are some changes.
Unfortuantely, the IDLE command is on a per-folder basis and blocks the
actual Thread. Therefore, if I want to use it, I would have to create a
thread for each folder. This solution has not really a good
performance.

I'm questioning myself now, if I'm using the command in the correct way.
Could you maybe help me? Are there other solutions?

By the way, I would also be notified if, for example, the flags change.
Therefore, a polling mechanism is not really the solution.

thanks for helping.

===========================================================================
To unsubscribe, send email to listserv@... and include in the body
of the message "signoff JAVAMAIL-INTEREST".  For general help, send email to
listserv@... and include in the body of the message "help".
 


=========================================================================== To unsubscribe, send email to listserv@... and include in the body of the message "signoff JAVAMAIL-INTEREST". For general help, send email to listserv@... and include in the body of the message "help".


Re: IMAP IDLE and synchronization

by Wolfgang Beikircher :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Thu, 2009-01-29 at 15:14 +0100, Ronald Klop wrote:
> Why?
>
> I don't know how much access you have to the servers. But it is
> probably more easy to do a backup-restore. Or rsync all the data
> periodicly.
> Or use existing software http://www.google.com/search?q=imapsync .
>
> Ronald.

Sorry, I didn't know about imapsync. In principle this tool would do
what I want. But I can't start it. I got the following error:

Sent 14 bytes
Can't call method "can_read" on an undefined value
at /usr/share/imapsync//Mail/IMAPClient.pm line 1588.

Anyway, I would like to implement it by myself. You know, to get a bit
familiar with JavaMail.

To your question of 'how much access I have to the server': there is no
access. I have only my user account with username and password. Nothing
more.

I will have now a look into this imapsync application. Maybe I can get
out some valuable things. Thanks for the hint!
>
Wolfgang.

>
> Op donderdag, 29 januari 2009 om 14:03 uur schreef Wolfgang Beikircher
> <wolfgang.beikircher@...>:
>
>          
>         Hey guys!
>        
>         I'm trying to realize a synchronization application which
>         keeps in sync
>         2 different mail server. Actually, I saw that javaMail
>         supports the IDLE
>         command to get notified by the server if there are some
>         changes.
>         Unfortuantely, the IDLE command is on a per-folder basis and
>         blocks the
>         actual Thread. Therefore, if I want to use it, I would have to
>         create a
>         thread for each folder. This solution has not really a good
>         performance.
>        
>         I'm questioning myself now, if I'm using the command in the
>         correct way.
>         Could you maybe help me? Are there other solutions?
>        
>         By the way, I would also be notified if, for example, the
>         flags change.
>         Therefore, a polling mechanism is not really the solution.
>        
>         thanks for helping.
>        
>         ===========================================================================
>         To unsubscribe, send email to listserv@... and
>         include in the body
>         of the message "signoff JAVAMAIL-INTEREST".  For general help,
>         send email to
>         listserv@... and include in the body of the message
>         "help".
>          
>        
>         ______________________________________________________________
>
--
Wolfgang Beikircher
Center for Applied Software Engineering (CASE)
Free University of Bozen/Bolzano
Mustergasse/Via della Mostra 4
39100 Bozen/Bolzano
Italy

===========================================================================
To unsubscribe, send email to listserv@... and include in the body
of the message "signoff JAVAMAIL-INTEREST".  For general help, send email to
listserv@... and include in the body of the message "help".

Re: IMAP IDLE and synchronization

by Bill Shannon :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Wolfgang Beikircher wrote:

> Hey guys!
>
> I'm trying to realize a synchronization application which keeps in sync
> 2 different mail server. Actually, I saw that javaMail supports the IDLE
> command to get notified by the server if there are some changes.
> Unfortuantely, the IDLE command is on a per-folder basis and blocks the
> actual Thread. Therefore, if I want to use it, I would have to create a
> thread for each folder. This solution has not really a good
> performance.
>
> I'm questioning myself now, if I'm using the command in the correct way.
> Could you maybe help me? Are there other solutions?
>
> By the way, I would also be notified if, for example, the flags change.
> Therefore, a polling mechanism is not really the solution.

Yes, a thread is required per folder.  The alternative would be for
JavaMail to have a dedicated thread that polled all the connections
in IDLE mode and dispatch the events to application threads.  That's
significantly more complicated so I took the simple approach when I
implemented this first version of IDLE support.

===========================================================================
To unsubscribe, send email to listserv@... and include in the body
of the message "signoff JAVAMAIL-INTEREST".  For general help, send email to
listserv@... and include in the body of the message "help".