~bigbes/core-go

ref: 1063e5b6eca536af07040ba929e872c3fc256444 core-go/email d---------
1063e5b6 — Simon Ser 2 years ago
email: make PGP private key optional

Services other than meta.sr.ht don't really have a use for the
private PGP key.

Add a CanPGPSign method so that meta.sr.ht can emit a warning or
error when the PGP key is missing.
a88277c1 — Simon Ser 2 years ago
email: improve mail.ParseAddress error message
bf4fe19c — наб 2 years ago
email: EnqueueStd: set Content-Type with charset=UTF-8 instead of just text/plain

Mails are now
	--11d2cbf164a9ae0dfbb310faf818762607dcfd20aa74e07c7be0eec1458d
	Mime-Version: 1.0
	Content-Transfer-Encoding: quoted-printable
	Content-Type: text/plain; charset=UTF-8

	=D1=82=D1=80=D1=83=D0=BF=D0=B08

	--=20
	View on the web: http://192.168.1.101:5003/~nab2/trupa/8
	--11d2cbf164a9ae0dfbb310faf818762607dcfd20aa74e07c7be0eec1458d
	Content-Type: application/pgp-signature

	-----BEGIN PGP MESSAGE-----

	wnUEARYIACcFAmUavj0JkKdioLsBS5scFiEE+ts/9LaoXcZuSmrHp2KguwFLmxwA
	AIm9AP9KB4cZyiby7jiiRMRESDeJXrdb4kNqyA3D3nVOt14bKgD/UiDfUKE1MwiV
	pOqj/S0wiJdChKW52zRAkwuQ7PtKkgI=
	=AiY9
	-----END PGP MESSAGE-----
	--11d2cbf164a9ae0dfbb310faf818762607dcfd20aa74e07c7be0eec1458d--
which is correct, and decodes correctly in neomutt.

Fixes: https://lists.sr.ht/~sircmpwn/sr.ht-discuss/%3C4uxbrlspm45s5i4bhhmqgmry374i22oqcxedtowda5zrzd7bpf2%405pyosds5owty%3E
78b6f723 — Conrad Hoffmann 3 years ago
email: remove content headers of passed-in message

The email has already been parsed according to the headers, but they are
still present. However, signing or encrypting the email will change the
content format, so remove any such headers before continuing.
2fd72e9f — Dennis Schön 3 years ago
email: handle error from Enqueue() in EnqueueStd()
bb33e3e7 — Simon Ser 3 years ago
email/worker: add more context to errors

For instance, failure to open the private PGP key would just fail
with an unhelpful "panic: open : no such file or directory" error.
8c2729f4 — Adnan Maolood 4 years ago
email.EnqueueStd: Don't overwrite headers

Sometimes we need to specify the Message-Id, From, and Reply-To headers
(e.g. for todo.sr.ht ticket notifications). Don't overwrite these
headers if they are present.
3f80f677 — Conrad Hoffmann 4 years ago
email: handle failure to encrypt notifications

Currently, failure to encrypt the notification email - e.g. due to an
expired key - will make the entire request fail. Instead, fall back to
sending an unencrypted email and let the request succeed (unless that
fails also, which is unlikely).
e28d47cf — Adnan Maolood 4 years ago
go fmt
f762ad22 — Peter Sanchez 4 years ago
Bugfix, mail config placed in wrong setting.
dd20891a — Julien Moutinho 4 years ago
Replace x/crypto package by ProtonMail/go-crypto to support ed25519 OpenPGP keys
31e77bac — Peter Sanchez 4 years ago
Add support for mail setups that don't support TLS or Auth
f44afb10 — Simon Ser 4 years ago
go fmt
48250772 — Simon Ser 4 years ago
Remove %e formatting verbs

%e is not valid for formatting error values:

> %e	scientific notation, e.g. -1.234456e+78

Instead, use %w when using fmt.Errorf (for error wrapping) and
%v when using log.Printf (%w is not valid in that context).
1371ba4b — Drew DeVault 4 years ago
Configure server to manage mail queue

This also sets up the recovery function for webhooks, so we get emailed
when we panic during a webhook query.
177d60f9 — Drew DeVault 5 years ago
Encrypt outgoing emails
606ff2ef — Drew DeVault 5 years ago
Sign outgoing emails
b7e39188 — Drew DeVault 5 years ago
Make worker logs less loud
14f4b921 — Drew DeVault 5 years ago
Expand context for work queues
9af62068 — Drew DeVault 5 years ago
email: remove leftover debug code
Next