MRatWork Forum by Mustafa Ramadhan

Sawo Project - Kloxo-MR Discussions => Kloxo-MR Technical Helps => Topic started by: chrisf on 2014-11-10, 15:52:25

Title: IMAP IDLE
Post by: chrisf on 2014-11-10, 15:52:25
Customer's are requesting push notifications for email accounts.  I was not familiar with this and started investigating our IMAP server.  From what I have read Dovecot supports the IMAP IDLE, but have not successfukly got it working on my android in tests.

Any help would be greatly appreciated.  Thank you.
Title: Re: IMAP IDLE
Post by: MRatWork on 2014-11-10, 18:56:26
Read https://qmail.jms1.net/scripts/. Maybe related to your asking.
Title: Re: IMAP IDLE
Post by: chrisf on 2014-11-10, 19:33:23
@Mustafa, that site is very outdated, the push email I am talking about is defined here:
http://www.isode.com/whitepapers/imap-idle.html (http://www.isode.com/whitepapers/imap-idle.html)

This is the best way for mobile devices to get 'instant' notification of new mail.  I am using K9 on android for testing (open source, on play store) and it is impressive.  Gmail, yahoo, and hotmail all support it.  When a new mail arrives i am notified instantly, no polling/fetching.

Courier Imap supports IMAP IDLE with the inclusion of FAM or Gamin, both open source.  I think special compiling is necessary.  Please read here:
http://forum.sp.parallels.com/threads/imap-idle-push-mail.287832/ (http://forum.sp.parallels.com/threads/imap-idle-push-mail.287832/)

And here, which mentions real time monitoring IMAP using FAM.
http://www.inter7.com/courierimap/INSTALL.html (http://www.inter7.com/courierimap/INSTALL.html)
And FAM:
http://oss.sgi.com/projects/fam/ (http://oss.sgi.com/projects/fam/)

This would be a great addition to KloxoMR, the world is going mobile! ;)

Please investigate Mustafa, thank you!
Title: Re: IMAP IDLE
Post by: MRatWork on 2014-11-10, 20:04:50
Try check 'yum list fam* gamin* --showduplicates'. Gamin already exists in CentOS.

If gamin installled, change 'IMAP_ENHANCEDIDLE=0' to 'IMAP_ENHANCEDIDLE=1' inside '/etc/courier/imapd'
Title: Re: IMAP IDLE
Post by: chrisf on 2014-11-10, 22:54:49
Gamin was installed, changed 0 to 1 in /etc/courier/imap.  Rebooted the server.

Push mail still not working.  I am wondering if courier was compiled with supoort for enhanced idle.
Title: Re: IMAP IDLE
Post by: MRatWork on 2014-11-10, 23:00:26
Gamin was installed, changed 0 to 1 in /etc/courier/imap.  Rebooted the server.

Push mail still not working.  I am wondering if courier was compiled with supoort for enhanced idle.
Look like no need re-compile but enough modified /etc/courier/imapd
Title: Re: IMAP IDLE
Post by: MRatWork on 2014-11-10, 23:07:43
Read http://www.courier-mta.org/imapd.html
Title: Re: IMAP IDLE
Post by: chrisf on 2014-11-11, 03:30:34
The reason that IDLE fails is imapd was not compiled with libfam.

Code: [Select]
[root@cc-server ~]# ldd /usr/bin/imapd
        linux-vdso.so.1 =>  (0x00007fffdddfe000)
        libgdbm.so.2 => /usr/lib64/libgdbm.so.2 (0x00007f0ee3086000)
        libcourierauth.so.0 => /usr/lib64/courier-authlib/libcourierauth.so.0 (0x00007f0ee2e7a000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f0ee2ae6000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f0ee329a000)
[root@cc-server ~]#
Regardless of gamin or fam, libfam should be compiled into imapd, the site you quoted also says so.  My tests all fail.

Can you re-compile with above and libfam?
Title: Re: IMAP IDLE
Post by: MRatWork on 2014-11-11, 04:28:55
The reason that IDLE fails is imapd was not compiled with libfam.

Code: [Select]
[root@cc-server ~]# ldd /usr/bin/imapd
        linux-vdso.so.1 =>  (0x00007fffdddfe000)
        libgdbm.so.2 => /usr/lib64/libgdbm.so.2 (0x00007f0ee3086000)
        libcourierauth.so.0 => /usr/lib64/courier-authlib/libcourierauth.so.0 (0x00007f0ee2e7a000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f0ee2ae6000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f0ee329a000)
[root@cc-server ~]#
Regardless of gamin or fam, libfam should be compiled into imapd, the site you quoted also says so.  My tests all fail.

Can you re-compile with above and libfam?
Yes, but unable to immediately. Maybe tomorrow.
Title: Re: IMAP IDLE
Post by: chrisf on 2014-11-11, 04:39:54
Thank you Mustafa.  I will be waiting for your update. :)
Title: Re: IMAP IDLE
Post by: chrisf on 2014-11-14, 20:50:28
I've been yum update.  No courier update yet.  Hope you can find the time, thank you again.
Title: Re: IMAP IDLE
Post by: MRatWork on 2014-11-14, 23:21:29
Courier recompile with 'BuildRequires' to 'gamin-devel' but imapd config still not changed. Try change to accept 'mail idle'.
Title: Re: IMAP IDLE
Post by: Hugo on 2014-11-17, 18:24:59
Hello,

I also would very much like to get IMAP Push working.

I see that courier-imap has been updated (thank you Mustafa)

Code: [Select]
# ldd /usr/bin/imapd
        linux-vdso.so.1 =>  (0x00007fffc8780000)
        libfam.so.0 => /usr/lib64/libfam.so.0 (0x00007fcacb138000)
        libgdbm.so.2 => /usr/lib64/libgdbm.so.2 (0x00007fcacaf31000)
        libcourierauth.so.0 => /usr/lib64/courier-authlib/libcourierauth.so.0 (0x00007fcacad26000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fcaca992000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fcacb34b000)

I have also changed 'IMAP_ENHANCEDIDLE=0' to 'IMAP_ENHANCEDIDLE=1' inside '/etc/courier/imapd'

Still no push notifications using Android's K9 Mail..  :-\
Title: Re: IMAP IDLE
Post by: chrisf on 2014-11-17, 22:26:13
I have been trying for days.  I can not get it to work.  When connected to imap the gamin server is active, yet no push notifications.  I must be missing something.