Recommend a replacement for mailwatch-plugin?

Grant Edwards grant.b.edwards at gmail.com
Fri Jun 11 22:40:31 CEST 2010


On 2010-06-10, Grant Edwards <grant.b.edwards at gmail.com> wrote:
> On 2010-06-08, Mike Massonnet <mmassonnet at gmail.com> wrote:
>> 2010/6/8 Grant Edwards <grant.b.edwards at gmail.com>:
>>> Can anybody recommend a good replacement for the mailwatch plugin?
>>
>> Yes mail-notification, it runs in the notification area.
>
> It looks like a nice program but it's a bit heavyweight.  It requires
> that I install Gnome.  I'd like something that requires only XFCE/GTk.
>
> I guess I'll write my own.  PyGTK is pretty straight-forward. The only
> mailbox type I need support for is IMAP, and Python has a nice library
> (imaplib2) that supports IDLE.

FWIW, I threw together an IMAP notifier in Python using PyGTK and
imaplib2, and it's working nicely under "normal" circumstances.  I
haven't had time to set up tests for things like dropped network
connections, servers timing out, temporary login failures, etc.  It's
about 150 lines of code and it has a couple features that I wanted but
couldn't find in other apps:

 1) Support for IMAP IDLE.  That provides "instant" notification of
    new mail without having to poll the server on a short cycle.

 2) After you click on a mailbox button to run an app (mutt, in my
    case), and that app terminates, it will immediately poll the
    mailbox to catch any changes that were made by that app.

The second feature isn't required if you delete/move new messages,
since IMAP IDLE will send an immediate notification of those changes.

However, if you read the new mail and then leave it in the INBOX, IMAP
IDLE won't notify you of the change in flag values.  [There is an IMAP
extension that will notify you of flag changes, but it's not supported
by any of the servers I use.]

Use of a persistent IMAP connection and the IDLE command results in
both quicker notification and much less overhead than the
new-ssl-connection-and-login for every poll cycle scheme that the
mailwatch plugin uses.

If the server doesn't support IMAP idle, it falls back on a normal
polling scheme (it still uses a persistent connection to avoid the
overhead of repeated SSL session setup and IMAP logins).

It's not a panel plugin, so it doesn't integrate quite as much with
XFCE.

It's a bit heavyweight when it comes to memory usage with a resident
set size of about 5MB (non-shared), but the ease of development and
testing when using Python makes it worth it.

I'll make the code available after I do some more testing and move the
configuration info into an external file.

-- 
Grant Edwards               grant.b.edwards        Yow! Youth of today!
                                  at               Join me in a mass rally
                              gmail.com            for traditional mental
                                                   attitudes!




More information about the Xfce mailing list