hoodwink.d enhanced


Mail Plugin for Ruby-Wmii #

by why in inspect

Using Mauricio’s ruby-wmii? I had a IMAP/POP3 checker in my last wmiirc and I decided to make it a plugin, to get familiar with Mauricio’s work. Put this in your ~/.wmii-3/plugins: mail-wmii-3.rb.

Add a few lines to your wmiirc-config.rb also:

 from "mail" do
   use_bar_applet "imap", 440

 plugin_config["mail:imap"]["host"] = 'imap.yourhost.com'
 plugin_config["mail:imap"]["boxes"] = ['INBOX', 'INBOX.IN.%']
 plugin_config["mail:imap"]["summarize_at"] = 3
 plugin_config["mail:imap"]["user"] = 'mail-user'
 plugin_config["mail:imap"]["pass"] = 'mail-password'
 plugin_config["mail:imap"]["use_ssl"] = true

One important line is the "boxes" setting. Use the percent sign as a wildcard for checking all boxes under a directory. Everything before the percent will be stripped when the box is displayed on the menu.

Yeah, hey, SSL support added by yard, sorry I overlooked.

said on 07 Jul 2006 at 06:24

Great script why, thanks! For the security conscious :

< #   plugin_config["mail:imap"]["use_ssl"] = true
< #   # certs:: where to find the server's CA cert
< #   plugin_config["mail:imap"]["certs"] = "/etc/ssl/certs" 
<           imap = Net::IMAP.new(conf['host'], conf['use_ssl'] ? 993 : 143, conf['use_ssl'], conf['certs'])
<           imap.login(conf['user'], conf['pass'])
>           imap = Net::IMAP.new(conf['host'])
>           imap.authenticate('LOGIN', conf['user'], conf['pass'])

The patch above lets you use imap over ssl if you want (and I strongly encourage you to do so).

I hope it works without ssl too, as I can’t test it with my current setup, but it should.

said on 08 Jul 2006 at 23:42

Neat! Keen! EffWhyEye: IMAP ’s logging statement is incorrectly labled ‘pop’.

said on 11 Jul 2006 at 10:33
I find that with my IMAP server (dovecot), I needed to apply this patch, or the thread would just hang after one or maybe two checks:

>           imap.logout
>           imap.disconnect

It may be a weird config issue on my server or somesuch, but it just doesn’t appreciate the no logout/disconnect.
11 Jul 2010 at 21:28

* do fancy stuff in your comment.