Simon Ser
b891a95fcf
Rename project to alps
4 år sedan
Simon Ser
13f5414691
cmd/koushin: add -debug flag
4 år sedan
Simon Ser
97eef13db4
Rename Session.connect to Session.connectIMAP
4 år sedan
Simon Ser
bdf1a8b02b
koushin: add Store interface
References: https://todo.sr.ht/~sircmpwn/koushin/5
4 år sedan
Simon Ser
c0b4998b38
koushin: rename Session.locker to imapLocker
4 år sedan
Simon Ser
e6e457e4a7
Fix dangling goroutine on session expiration
The timer channel may already have been drained by `case <-timer.C`. In
this case, we need not to drain it again or we'll block forever.
To fix this, stop draining the timer channel. Since we're not going to
use the timer again anyway, it should be fine.
4 år sedan
Simon Ser
8b10324ab6
go fmt
4 år sedan
Simon Ser
425445f443
Add Session.SetHTTPBasicAuth
This is not 100% idiot-proof, but still makes it mroe difficult for
plugins to steal credentials.
4 år sedan
Simon Ser
6bccdd62ce
Document that plugins don't have access to passwords
4 år sedan
Simon Ser
7f48702b83
go fmt
4 år sedan
Simon Ser
622f00fe06
Replace Session.ConnectSMTP with Session.DoSMTP
This gives more flexibility in Session for optimizations, e.g. keep the
SMTP connection around for some time if possible.
4 år sedan
Simon Ser
d01c85616a
Rename Session.Do to Session.DoIMAP
4 år sedan
Simon Ser
d897eeee5c
Introduce base plugin
This plugin offers base IMAP/SMTP functionality.
References: https://todo.sr.ht/~sircmpwn/koushin/39
4 år sedan
Simon Ser
b24cc85fb1
Fix undefined ErrSessionExpired
Fixes: f07ab52632
("Add docs")
4 år sedan
Simon Ser
f07ab52632
Add docs
4 år sedan
Simon Ser
e54a359acb
Export Server.{Sessions,Plugins}
And unexport a few internal functions.
4 år sedan
Simon Ser
28a8f3f6ac
Unexport NewSessionManager
This isn't intended to be used by plugins.
4 år sedan
Simon Ser
86359156ee
Export Context.SetSession, unexport Session.Token
I'm uneasy exposing the token to plugins, I prefer to hide it if
possible to prevent mis-use.
This change allows plugins to logout users.
4 år sedan
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
4 år sedan
Simon Ser
7702925497
Make SessionManager create the IMAP client
This will allow SessionManager to re-connect when the IMAP server logs
the user out.
4 år sedan
Simon Ser
efd401bfbf
Rename ConnPool to SessionManager
4 år sedan
Simon Ser
8de93c50d2
Add basic pagination to message list
References: https://todo.sr.ht/~sircmpwn/koushin/22
4 år sedan
Simon Ser
48d6d5d227
Add session lock
HTTP requests can be processed in parallel, but we only have one IMAP
connection per session.
Closes: https://todo.sr.ht/~sircmpwn/koushin/12
4 år sedan
Simon Ser
89cebfd819
Add basic SMTP support
4 år sedan
Simon Ser
702719c072
Save username/password in session
This is required for authenticating with the SMTP server when composing
a new message.
4 år sedan
Simon Ser
4cbe2fde9d
go fmt
4 år sedan
Simon Ser
594bb2ec19
Add synchronization to connection pool
4 år sedan
Simon Ser
85f8530fd3
Evict connection pool entry on logout
4 år sedan
Simon Ser
8b84d81f9b
Add initial login logic
4 år sedan