Simon Ser
b325933a8b
Add .editorconfig
4 years ago
Simon Ser
3384c39a17
plugins/base: delete previous draft
4 years ago
Simon Ser
d31c56ec98
plugins/base: edit drafts
Note that attachments will be lost. This is a TODO.
4 years ago
Simon Ser
2e367efe58
plugins/base: add fallback if SPECIAL-USE is unsupported
4 years ago
Simon Ser
bfc617b702
plugins/base: save message as draft
4 years ago
Simon Ser
267999b6e5
Update docs with new RegisterPluginLoader function
4 years ago
Simon Ser
baae776247
readme: fix example usage
4 years ago
Simon Ser
3347e69480
Use %q to quote values in format strings
4 years ago
Simon Ser
9fdccc3a4b
Rename template.go to renderer.go
4 years ago
Simon Ser
b58c15d121
Extract Lua infrastructure into a plugin
4 years ago
Simon Ser
efa0816333
Add Server.Logger
4 years ago
Simon Ser
01983eb7b5
Introduce PluginLoaderFunc
This allows registered plugins to execute code when loaded. This will
also allow the Lua support code to be a plugin.
Closes: https://todo.sr.ht/~sircmpwn/koushin/54
4 years ago
Simon Ser
d19c17c6d5
go fmt
4 years ago
Simon Ser
589b303f9f
plugins/base: append outgoing messages to Sent mailbox
And mark original message as answered.
Closes: https://todo.sr.ht/~sircmpwn/koushin/15
4 years ago
Simon Ser
3340fcd63d
Check IMAP/SMTP servers on startup
Closes: https://todo.sr.ht/~sircmpwn/koushin/46
4 years ago
Simon Ser
3bf17752ab
plugins/base: remove external resources URLs, sanitize CSS
4 years ago
Simon Ser
b9a180b154
Disable DNS prefetching
4 years ago
Simon Ser
a66ef1059b
Make the text/* part content a []byte
4 years ago
Simon Ser
8d248bc32f
Extract HTML sanitizer to its own file
4 years ago
Simon Ser
d745f98bb7
Add polyfill for browsers not supporting srcdoc
4 years ago
Simon Ser
efaf6fd444
Open e-mail links in new tab
4 years ago
Simon Ser
721c3ce3eb
Resize e-mail iframe with content
4 years ago
Simon Ser
af5ffd12f9
Add support for HTML parts
4 years ago
Simon Ser
577685ca14
Update dependencies
4 years ago
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 years ago
Simon Ser
8b10324ab6
go fmt
4 years ago
Simon Ser
a0800c2436
Auto-discover upstream SMTP and IMAP servers
Closes: https://todo.sr.ht/~sircmpwn/koushin/49
4 years ago
Simon Ser
db328bf7c3
Generalize upstream server URLs
koushin now takes a list of upstream URLs instead of an IMAP and SMTP
URL. This allows to specify upstream server URLs for plugins. In the
future, this will allow for auto-discovering upstream servers based on a
single domain name.
References: https://todo.sr.ht/~sircmpwn/koushin/49
4 years ago
Reto Brunner
d5124c9645
Hide echo banner
4 years ago
Dejan Strbac
83a5132d15
Add current path to the global context
4 years ago
Dejan Strbac
15a77185b4
Include flags when fetching items over IMAP
4 years ago
Simon Ser
425445f443
Add Session.SetHTTPBasicAuth
This is not 100% idiot-proof, but still makes it mroe difficult for
plugins to steal credentials.
4 years ago
Simon Ser
c38b1d47f9
Fix panic when injecting a template with nil data
4 years ago
Simon Ser
24718f1ac4
Redirect to original URL after login
4 years ago
Simon Ser
b014c1898f
Close Lua plugins on reload
4 years ago
Simon Ser
171da51289
cmd/koushin: add -addr flag
4 years ago
Simon Ser
04199eb121
readme: document hot reload
4 years ago
Simon Ser
ad1d2ee7f4
Implement plugin/template reload on SIGUSR1
There's no way around having a global mutex, because we need to update
the HTTP routes when reloading plugins. During reload we need to lock
the whole server.
Closes: https://todo.sr.ht/~sircmpwn/koushin/43
4 years ago
Simon Ser
3d8569d185
cmd/koushin: reload on SIGUSR1
References: https://todo.sr.ht/~sircmpwn/koushin/43
4 years ago
Simon Ser
97b314b6e7
Add Server.Reload
This only reloads templates for now. In the future it'll also reload
Lua plugins.
4 years ago
Simon Ser
f6758264b2
Make New return the Server
This will be useful to implement hot reload.
4 years ago
Simon Ser
3d9ddc05be
themes/sourcehut: add search input to mailbox view
4 years ago
Simon Ser
d36ec520aa
Fix extra comma in address list
4 years ago
Simon Ser
8c4587f477
Fix header missing from raw e-mail download
4 years ago
Simon Ser
3d2da43207
Add a default CSP
Disallows loading external ressources. Providers can override it with
their reverse proxy settings.
4 years ago
Simon Ser
80da410c3b
Implement paging for search
4 years ago
Simon Ser
6bccdd62ce
Document that plugins don't have access to passwords
4 years ago
Simon Ser
f106c1125f
Make Go plugin handlers take a *Context
Take a *Context instead of a echo.Context. This saves a type assertion
in each handler.
4 years ago
Simon Ser
020e27fe45
Add Context to Plugin.Inject
This allows to access the request metadata and the session from injectors.
4 years ago
Simon Ser
ca3672df2a
Add RenderData interface
This allows Go plugins to easily inject global data.
4 years ago