Rearrange thread template
37babb1d — Philippe Pepiot 18 days ago
Allow to serve lmtp on tcp and smtp on unix socket

We previously used "sock" parameter to determine if protocol should be
lmtp (unix socket) or smtp (tcp).
Since it make sense to serve both protocols on tcp or unix socket, introduce a
new "protocol" parameter to switch between lmtp and smtp.
Keep backward compat when protocol is not set by using lmtp over unix
socket and smtp over tcp socket.

Also evaluate "sock-group" option only when using unix socket, so the
option is no longer mandatory for tcp where it's unused.
Add a trailing "\n" to email body before parsing diff

Emails from Mercurial apparently do not have a line ending; this is
problematic when trying to parse them with pygit2.Diff.parse_diff()
because there is no "signature" ("-- \n<git version>") and the body ends
with the last hunk which hence fails to parse with "invalid patch
instruction at line NN" error:

  https://github.com/libgit2/libgit2/blob/v0.28.3/src/patch_parse.c#L550
Add is:thread & is:reply filters

Also, fix bug where 'in_reply_to' never gets set.

Closes https://todo.sr.ht/~sircmpwn/lists.sr.ht/82.
Add Archived-At header to list copies

Closes https://todo.sr.ht/~sircmpwn/lists.sr.ht/122
Remove unidiff in favor of pygit2

Closes https://todo.sr.ht/~sircmpwn/lists.sr.ht/101
Add a build manifest for Debian packaging
Fix syntax of List-ID header (RFC 2919)

This patch fixes the List-ID header to conform to the RFC 2919 [1]
syntax specification. In particular, the '@` is not supported by
the list-id token as is seen in the RFC:

list-id-header = "List-ID:" [phrase] "<" list-id ">" CRLF
list-id = list-label "." list-id-namespace
list-label = dot-atom-text
(from RFC 2822 [2]) dot-atom-text = 1*atext *("." 1*atext)

where atext does not include the '@' character.
Updates per core.sr.ht centered design
Prefer smtp.send_message over smtp.sendmail

This lets smtplib deal with choosing the right message formatting based on the
remote server's capabilities.
Mark our messages as Auto-Submitted
Drop auto-submitted replies

The current code doesn't drop auto-submitted replies, it only drops
auto-generated messages (that are not a direct reply to another message).
See [1].

[1]: https://tools.ietf.org/html/rfc3834#section-5.1

Closes: https://todo.sr.ht/~sircmpwn/lists.sr.ht/124
Add mailing list description to threads
Drop out-of-office replies
Don't split header fields

By default Python's policy has max_line_length=78. This is a good idea when
generating e-mails, however when forwarding them this may re-format long lines.
Because of this, DKIM signatures may get broken [1].

This commit changes max_line_length to 998, the RFC's hard limit.

Additionally, smtp.sendmail calls are replaced with smtp.send_message, which
leaves the formatting to smtplib. Previously email.policy.SMTPUTF8 was used,
which could result in raw UTF-8 being sent to servers which don't support
8BITMIME.

[1]: https://lists.sr.ht/~sircmpwn/sr.ht-discuss/%3C5eyQeHZnsPZb93CeySB5Z78iohHq9_ki7b8rpigjSL8PcrEpPXBViekRWAfua1L1XiP6-bKau7YRp1Rk9PyrjzD_BkiKKN_pkl6jVihvBf8%3D%40emersion.fr%3E#%3CftBrXTFwtU92zRoZnFxa6vMhBqHSdUO-l2ds0l4PA_OVhANM2ArVYMKr4WDaq4Yg4o7C3MtWPRg1QKxwXSADVJiDWocYC8wa2ylEoxoOJX4=@emersion.fr%3E
Send our own bounce emails instead of postfix
Allow admins to permit multipart emails with HTML
Import db into api/patches.py
Don't show message date if unset
Add search to API, sender timestamp criteria
Next