unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* Forward email error - forward-sexp: Scan error
@ 2024-03-18 15:21 Jon Fineman
  2024-03-19 12:17 ` David Bremner
  0 siblings, 1 reply; 4+ messages in thread
From: Jon Fineman @ 2024-03-18 15:21 UTC (permalink / raw)
  To: notmuch

Received this error while trying to forward a complex html email from ebay.

Unfortunately there is probably some PII embedded in it, so trying to
remove that to include the email might confuse things.

Any suggestions on how to find the error?


Sending...
forward-sexp: Scan error: "Unbalanced parentheses", 22384, 32216


I am on
OpenBSD current
notmuch 0.38.2
emacs 29.2

Thanks.

Jon


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Forward email error - forward-sexp: Scan error
  2024-03-18 15:21 Forward email error - forward-sexp: Scan error Jon Fineman
@ 2024-03-19 12:17 ` David Bremner
  2024-03-19 13:26   ` Jon Fineman
  0 siblings, 1 reply; 4+ messages in thread
From: David Bremner @ 2024-03-19 12:17 UTC (permalink / raw)
  To: Jon Fineman, notmuch

Jon Fineman <jon@fineman.me> writes:

> Received this error while trying to forward a complex html email from ebay.
>
> Unfortunately there is probably some PII embedded in it, so trying to
> remove that to include the email might confuse things.
>
> Any suggestions on how to find the error?
>
>
> Sending...
> forward-sexp: Scan error: "Unbalanced parentheses", 22384, 32216
>
>

Does "M-x toggle-debug-on-error" yield a useful backtrace?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Forward email error - forward-sexp: Scan error
  2024-03-19 12:17 ` David Bremner
@ 2024-03-19 13:26   ` Jon Fineman
  2024-04-03 10:33     ` David Bremner
  0 siblings, 1 reply; 4+ messages in thread
From: Jon Fineman @ 2024-03-19 13:26 UTC (permalink / raw)
  To: David Bremner, notmuch; +Cc: Jon Fineman

David Bremner <david@tethera.net> writes:

> Jon Fineman <jon@fineman.me> writes:
>
>> Received this error while trying to forward a complex html email from ebay.
>>
>> Unfortunately there is probably some PII embedded in it, so trying to
>> remove that to include the email might confuse things.
>>
>> Any suggestions on how to find the error?
>>
>>
>> Sending...
>> forward-sexp: Scan error: "Unbalanced parentheses", 22384, 32216
>>
>>
>
> Does "M-x toggle-debug-on-error" yield a useful backtrace?


Debugger entered--Lisp error: (scan-error "Unbalanced parentheses" 22384 32216)
  scan-sexps(22384 1)
  forward-sexp()
  mml-expand-html-into-multipart-related((part (type . "text/html") (charset . "UTF-8") (nofile . "yes") (tag-location . 907) (contents . "<!DOCTYPE html>\n<!--a71f943b-ab8b-549b-4cb2-514a60...")))
  mml-expand-all-html-into-multipart-related((part (type . "text/html") (charset . "UTF-8") (nofile . "yes") (tag-location . 907) (contents . "<!DOCTYPE html>\n<!--a71f943b-ab8b-549b-4cb2-514a60...")))
  mml-expand-all-html-into-multipart-related((multipart (type . "mixed") (tag-location . 883) (part (type . "text/html") (charset . "UTF-8") (nofile . "yes") (tag-location . 907) (contents . "<!DOCTYPE html>\n<!--a71f943b-ab8b-549b-4cb2-514a60..."))))
  mapcar(mml-expand-all-html-into-multipart-related ((part (type . "text/plain") (contents . "\n-------------------- Start of forwarded message -...")) (multipart (type . "mixed") (tag-location . 883) (part (type . "text/html") (charset . "UTF-8") (nofile . "yes") (tag-location . 907) (contents . "<!DOCTYPE html>\n<!--a71f943b-ab8b-549b-4cb2-514a60..."))) (part (type . "text/plain") (contents . "-------------------- End of forwarded message ----..."))))
  mml-generate-mime(nil nil)
  message-encode-message-body()
  message-send-mail(nil)
  message-send-via-mail(nil)
  message-send(nil)
  message-send-and-exit(nil)
  notmuch-mua-send-common(nil t)
  notmuch-mua-send-and-exit(nil)
  funcall-interactively(notmuch-mua-send-and-exit nil)
  call-interactively(notmuch-mua-send-and-exit nil nil)
  command-execute(notmuch-mua-send-and-exit)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Forward email error - forward-sexp: Scan error
  2024-03-19 13:26   ` Jon Fineman
@ 2024-04-03 10:33     ` David Bremner
  0 siblings, 0 replies; 4+ messages in thread
From: David Bremner @ 2024-04-03 10:33 UTC (permalink / raw)
  To: Jon Fineman, notmuch; +Cc: Jon Fineman

Jon Fineman <jon@fineman.me> writes:

> Debugger entered--Lisp error: (scan-error "Unbalanced parentheses" 22384 32216)
>   scan-sexps(22384 1)
>   forward-sexp()
>   mml-expand-html-into-multipart-related((part (type . "text/html") (charset . "UTF-8") (nofile . "yes") (tag-location . 907) (contents . "<!DOCTYPE html>\n<!--a71f943b-ab8b-549b-4cb2-514a60...")))
>   mml-expand-all-html-into-multipart-related((part (type . "text/html") (charset . "UTF-8") (nofile . "yes") (tag-location . 907) (contents . "<!DOCTYPE html>\n<!--a71f943b-ab8b-549b-4cb2-514a60...")))
>   mml-expand-all-html-into-multipart-related((multipart (type . "mixed") (tag-location . 883) (part (type . "text/html") (charset . "UTF-8") (nofile . "yes") (tag-location . 907) (contents . "<!DOCTYPE html>\n<!--a71f943b-ab8b-549b-4cb2-514a60..."))))
>   mapcar(mml-expand-all-html-into-multipart-related ((part (type . "text/plain") (contents . "\n-------------------- Start of forwarded message -...")) (multipart (type . "mixed") (tag-location . 883) (part (type . "text/html") (charset . "UTF-8") (nofile . "yes") (tag-location . 907) (contents . "<!DOCTYPE html>\n<!--a71f943b-ab8b-549b-4cb2-514a60..."))) (part (type . "text/plain") (contents . "-------------------- End of forwarded message ----..."))))
>   mml-generate-mime(nil nil)

Is that HTML part confidential? My current guess is that it is
triggering a bug in the HTML parsing in GNUs. The call to forward-sexp
which is failing seems to be used (along with a special syntax table)
for selecting the region to be parsed by libxml. I do not see any
handling of malformed HTML in the corresponding function. Perhaps this
happens somewhere else, but another possibility is there isn't any
checks.

If the part is confidential, and you can isolate it, please run it
through some strict syntax checker. It could also be that the
assumptions about <> structure being balanced are violated in various
ways by syntactically correct HTML.

David

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-04-03 10:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-18 15:21 Forward email error - forward-sexp: Scan error Jon Fineman
2024-03-19 12:17 ` David Bremner
2024-03-19 13:26   ` Jon Fineman
2024-04-03 10:33     ` David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).