Discussion:
IMAP IDLE and synchronization
Wolfgang Beikircher
2009-01-29 13:03:41 UTC
Permalink
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 ***@java.sun.com and include in the body
of the message "signoff JAVAMAIL-INTEREST". For general help, send email to
***@java.sun.com and include in the body of the message "help".
Ronald Klop
2009-01-29 14:14:30 UTC
Permalink
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.
Post by 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.
===========================================================================
of the message "signoff JAVAMAIL-INTEREST". For general help, send email to
===========================================================================
To unsubscribe, send email to ***@java.sun.com and include in the body
of the message "signoff JAVAMAIL-INTEREST". For general help, send email to
***@java.sun.com and include in the body of the message "help".
Wolfgang Beikircher
2009-01-29 17:16:58 UTC
Permalink
Post by Ronald Klop
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.
Post by Ronald Klop
Op donderdag, 29 januari 2009 om 14:03 uur schreef 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.
===========================================================================
of the message "signoff JAVAMAIL-INTEREST". For general help,
send email to
______________________________________________________________
--
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 ***@java.sun.com and include in the body
of the message "signoff JAVAMAIL-INTEREST". For general help, send email to
***@java.sun.com and include in the body of the message "help".
Bill Shannon
2009-01-29 19:01:47 UTC
Permalink
Post by 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.
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 ***@java.sun.com and include in the body
of the message "signoff JAVAMAIL-INTEREST". For general help, send email to
***@java.sun.com and include in the body of the message "help".
Loading...