[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#42029: `gnus-registry-spool-action' gets field beyond message header
From: |
Eric Abrahamsen |
Subject: |
bug#42029: `gnus-registry-spool-action' gets field beyond message headers |
Date: |
Wed, 24 Jun 2020 10:25:41 -0700 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
tomotaka.suwa@gmail.com writes:
> Hi,
>
> I've been suffering from `mail-source-crash-box' on getting new mail.
>
> After some debug and investigation, I noticed that
> `mail-extract-address-components' was failing by invalid addresses.
>
> The issue happened in `gnus-registry-spool-action' and invalid addresses
> are passed by calling `message-fetch-field' on the buffer not narrowed
> to message headers.
>
> Below snippet reproduce the root issue:
>
> (with-temp-buffer
> (save-excursion
> ;; mail header
> (insert "From: from@bar.com\n"
> "To: to@bar.com\n"
> "Subject: test\n")
> (newline)
> ;; mail body
> (insert "message\n"
> "Cc: >,@ <foo@bar.com>\n")) ;; by incorrect decode
> (gnus-registry-spool-action 1 "test"))
>
> In stead of `message-fetch-field', calling `message-field-value' would
> solve the problem since it ensures the buffer is narrowed at first.
Thanks for this report. It might be simpler to wrap the whole thing in a
single save-restriction+narrow-to-headers, since the function gets
called four times. What do you think?