~rjarry/aerc-devel

aerc: rfc822: log and skip on part parse failure v1 NEEDS REVISION

Maarten Aertsen: 1
 rfc822: log and skip on part parse failure

 1 files changed, 2 insertions(+), 1 deletions(-)
#1317299 alpine-edge.yml failed
#1317300 openbsd.yml success
Hey Tim,

Appreciate you looking into this!
Next
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~rjarry/aerc-devel/patches/54831/mbox | git am -3
Learn more about email & git

[PATCH aerc] rfc822: log and skip on part parse failure Export this patch

Skip parts that contain errors and log them, instead of returning an
error immediately, thereby giving up on the entire message.

Found in a message with a part containing an invalid Content-Disposition
header that contained a space in the (unquoted) filename parameter.

(Known not to pass the TestMessageInfoHandledError/hexa test for now.  
It needs to be rewritten if we want this new behaviour.)

Signed-off-by: Maarten Aertsen <maarten@nlnetlabs.nl>
---
 lib/rfc822/message.go | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/rfc822/message.go b/lib/rfc822/message.go
index 653cb2fe..44b68ab2 100644
--- a/lib/rfc822/message.go
+++ b/lib/rfc822/message.go
@@ -123,7 +123,8 @@ func ParseEntityStructure(e *message.Entity) (*models.BodyStructure, error) {
			}
			ps, err := ParseEntityStructure(part)
			if err != nil {
				return nil, fmt.Errorf("could not parse child entity structure: %w", err)
				log.Errorf("could not parse child entity structure: %w, skipping part", err)
				continue
			}
			body.Parts = append(body.Parts, ps)
		}
-- 
2.46.0
aerc/patches: FAILED in 1m40s

[rfc822: log and skip on part parse failure][0] from [Maarten Aertsen][1]

[0]: https://lists.sr.ht/~rjarry/aerc-devel/patches/54831
[1]: mailto:maarten@nlnetlabs.nl

✗ #1317299 FAILED  aerc/patches/alpine-edge.yml https://builds.sr.ht/~rjarry/job/1317299
✓ #1317300 SUCCESS aerc/patches/openbsd.yml     https://builds.sr.ht/~rjarry/job/1317300