From 5bc73de59d9f01ec8497ac8ff142506fd7a40876 Mon Sep 17 00:00:00 2001 From: sterni Date: Tue, 1 Feb 2022 00:01:59 +0100 Subject: feat: move mblog header handling into mime4cl Accessing the headers of a MIME message feels like something mime4cl should handle. We implemented this ad hoc in mblog before in order to not need to worry about doing it in a sensible way. Now we introduce a decent-ish interface for getting a header from a MIME message, mime-message-header-values: * It returns a list because MIME message headers may appear multiple times. * It decodes RFC2047 only upon request, as you may want to be stricter about parsing certain fields. * It checks header name equality case insensitively. The code for decoding the RFC2047 string is retained and still uses babel for doing the actual decoding. Change-Id: I58bbbe4b46dbded04160b481a28a40d14775673d Reviewed-on: https://cl.tvl.fyi/c/depot/+/5150 Tested-by: BuildkiteCI Reviewed-by: sterni --- third_party/lisp/mime4cl/package.lisp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'third_party/lisp/mime4cl/package.lisp') diff --git a/third_party/lisp/mime4cl/package.lisp b/third_party/lisp/mime4cl/package.lisp index b1217a0b6818..5586bdc390e5 100644 --- a/third_party/lisp/mime4cl/package.lisp +++ b/third_party/lisp/mime4cl/package.lisp @@ -30,6 +30,8 @@ #:process-wait #:process-alive-p #:run-program) + (:import-from :babel :octets-to-string) + (:import-from :babel-encodings :get-character-encoding) (:export #:*lazy-mime-decode* #:print-mime-part #:read-mime-message @@ -61,6 +63,7 @@ #:mime-type-string #:mime-type-parameters #:mime-message-headers + #:mime-message-header-values #:mime= #:find-mime-part-by-path #:find-mime-part-by-id -- cgit 1.4.1