todosrht-lmtp: try a bit harder to parse msg ID

Even though it is rarely used, the full format of the Message-ID header
is (grossly simplified): "Comment to be ignored <actual@message.id>",
similar to an address. Parsing this as address will still be a bit too
lax (it would accept quoted string literals on the left-id side), but
it's at least much better than the current approach.
This commit is contained in:
Conrad Hoffmann 2024-01-26 13:31:40 +01:00 committed by Drew DeVault
parent 7348b4a29b
commit fb651a7997
1 changed files with 1 additions and 1 deletions

View File

@ -177,7 +177,7 @@ class MailHandler:
input = {
"text": body,
"senderId": sender.id,
"messageId": mail["Message-ID"].removeprefix("<").removesuffix(">"),
"messageId": parseaddr(mail["Message-ID"])[1],
}
cmds = ["!resolve", "!resolved", "!reopen"]