Commit graph

6 commits

Author SHA1 Message Date
Simon Ser
c5afd1a61b
Reconnect to IMAP server when logged out
The session manager has been upgraded to deal with reconnections.

Each session has its own expiration timer. Each time a request is
received, the expiration timer is reset.

A session can be closed (this is used when the user wants to logout).

When the IMAP connection is closed by the server, it's set to nil in the
session. The next time an IMAP command needs to be issued, the
connection is re-established.

Closes: https://todo.sr.ht/~sircmpwn/koushin/30
2019-12-09 19:35:15 +01:00
Simon Ser
7702925497
Make SessionManager create the IMAP client
This will allow SessionManager to re-connect when the IMAP server logs
the user out.
2019-12-09 18:35:51 +01:00
Simon Ser
efd401bfbf
Rename ConnPool to SessionManager 2019-12-09 18:16:31 +01:00
Simon Ser
9617b412e8
Make render data static
This makes sure fields filled by vanilla koushin keep the right type. A
new Extra field allows plugins to attach their own data.

This also makes it easier to write Go plugins, which would have trouble
working with interface{}.
2019-12-09 16:17:36 +01:00
Simon Ser
61ffc105fd
Use imap.BodyStructure.Filename and imap.Address.Address
The former fixes encoding issues in filenames. The latter is just for
brevity.
2019-12-09 13:45:15 +01:00
Simon Ser
d1d4380957
Extract HTTP handlers in separate file 2019-12-04 20:55:08 +01:00