mirror of
https://github.com/mjl-/mox.git
synced 2025-07-10 07:14:40 +03:00
webmail: implement registering and handling "mailto:" links
to start composing a message. the help popup now has a button to register the "mailto:" links with the mox webmail (typically only works over https, not all browsers support it). the mailto links are specified in 6068. we support the to/cc/bcc/subject/body parameters. other parameters should be seen as custom headers, but we don't support messages with custom headers at all at the moment, so we ignore them. we now also turn text of the form "mailto:user@host" into a clickable link (will not be too common). we could be recognizing any "x@x.x" as email address and make them clickable in the future. thanks to Hans-Jörg for explaining this functionality.
This commit is contained in:
@ -1782,6 +1782,13 @@ func recipientSecurity(ctx context.Context, resolver dns.Resolver, messageAddres
|
||||
return rs, nil
|
||||
}
|
||||
|
||||
// DecodeMIMEWords decodes Q/B-encoded words for a mime headers into UTF-8 text.
|
||||
func (Webmail) DecodeMIMEWords(ctx context.Context, text string) string {
|
||||
s, err := wordDecoder.DecodeHeader(text)
|
||||
xcheckuserf(ctx, err, "decoding mime q/b-word encoded header")
|
||||
return s
|
||||
}
|
||||
|
||||
func slicesAny[T any](l []T) []any {
|
||||
r := make([]any, len(l))
|
||||
for i, v := range l {
|
||||
|
Reference in New Issue
Block a user