All patches and comments are welcome. Please squash your changes to logical
commits before using git-format-patch and git-send-email to
patches@git.madduck.net.
If you'd read over the Git project's submission guidelines and adhered to them,
I'd be especially grateful.
1 [<- widgets](https://github.com/copycat-killer/lain/wiki/Widgets)
3 **Please be warned**: this is a temporary solution, since it works fine in normal situations but causes little freezes if connection is sobbing. I am working on something much more solid.
7 Shows mail status in a textbox over IMAP protocol.
9 New mails are notified through a notification like this:
11 +---------------------------------------------------+
13 | |\ /| donald@disney.org has 3 new messages |
15 | Latest From: Mickey Mouse <boss@disney.org> |
16 | Subject: Re: pay raise |
18 | Not after what you did yesterday. |
19 | Daisy told me everything [...] |
21 +---------------------------------------------------+
23 Text will be cut if the mail is too long.
25 myimapcheck = lain.widgets.imap(args)
27 The function takes a table as argument. Required table parameters are:
29 Variable | Meaning | Type
31 `server` | Mail server | string
32 `mail` | User mail | string
33 `password` | User password | string
35 while the optional are:
37 Variable | Meaning | Type | Default
39 `port` | IMAP port | int | 993
40 `timeout` | Refresh timeout seconds | int | 60
41 `encoding` | Mail character encoding | string | autodetected
42 `maxlen` | Maximum chars to display in notification | int | 200
43 `is_plain` | Define whether `password` is a plain password (true) or a function that retrieves it (false) | boolean | false
44 `settings` | User settings | function
46 Let's focus better on `is_plain`.
48 You can just set your password like this:
51 args.password = "mypassword"
53 and you'll have the same security provided by `~/.netrc`.
55 **Or** you can use a keyring, like [python keyring](https://pypi.python.org/pypi/keyring):
57 args.password = "keyring get password"
59 When `is_plain == false`, it *executes* `password` before using it, so you can also use whatever password fetching solution you want.
61 `settings` can use the string `mailcount`, whose possible values are:
64 - "invalid credentials"
67 and can modify `notification_preset` table, which will be the preset for the naughty notifications. Check [here](http://awesome.naquadah.org/doc/api/modules/naughty.html#notify) for the list of variables it can contain. Default definition:
69 notification _preset = {
70 icon = lain/icons/mail.png,