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**: as for now, this works fine in normal link situations, but is discouraged to use it if your connection is sobbing, since it may cause some short freezes. I am at work to solve this.
5 Shows mail status in a textbox over IMAP protocol.
7 New mails are notified through a notification like this:
9 +---------------------------------------------------+
11 | |\ /| donald@disney.org has 3 new messages |
13 | Latest From: Mickey Mouse <boss@disney.org> |
14 | Subject: Re: pay raise |
16 | Not after what you did yesterday. |
17 | Daisy told me everything [...] |
19 +---------------------------------------------------+
21 Text will be cut if the mail is too long.
23 myimapcheck = lain.widgets.imap(args)
25 The function takes a table as argument. Required table parameters are:
27 Variable | Meaning | Type
29 `server` | Mail server | string
30 `mail` | User mail | string
31 `password` | User password | string
33 while the optional are:
35 Variable | Meaning | Type | Default
37 `port` | IMAP port | int | 993
38 `timeout` | Refresh timeout seconds | int | 60
39 `encoding` | Mail character encoding | string | autodetected
40 `maxlen` | Maximum chars to display in notification | int | 200
41 `is_plain` | Define whether `password` is a plain password (true) or a function that retrieves it (false) | boolean | false
42 `settings` | User settings | function
44 Let's focus better on `is_plain`.
46 You can just set your password like this:
49 args.password = "mypassword"
51 and you'll have the same security provided by `~/.netrc`.
53 **Or** you can use a keyring, like [python keyring](https://pypi.python.org/pypi/keyring):
55 args.password = "keyring get password"
57 When `is_plain == false`, it *executes* `password` before using it, so you can also use whatever password fetching solution you want.
59 `settings` can use the string `mailcount`, whose possible values are:
62 - "invalid credentials"
65 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:
67 notification _preset = {
68 icon = lain/icons/mail.png,