discourse/spec/lib/email
Régis Hanol d523c37057
FIX: correctly extract body and/or reply from exchange emails (#30512)
When receiving emails sent with Exchange, we look for some markers to identify the body of the mail and the reply (aka. previous email).

For some reasons, those markers aren't 100% reliable and sometimes, only one of them is present.

The commit 20ba54d536 introduced the bug because the `HTML_EXTRACTERS` regex for exchange looks for either `messageBodySection` or `messageReplySection` but we were only using the `reply` section. So if an email had only the `body` section, it would not be correctly extracted.

This commit handle the cases where either one of them is missing and use the other one as the actual "reply". When both are present, it correctly elides the "reply" section.
2024-12-31 15:29:36 +01:00
..
authentication_results_spec.rb DEV: Fix various rubocop lints (#24749) 2023-12-06 23:25:00 +01:00
cleaner_spec.rb DEV: Apply syntax_tree formatting to `spec/*` 2023-01-09 11:49:28 +00:00
email_spec.rb DEV: Apply syntax_tree formatting to `spec/*` 2023-01-09 11:49:28 +00:00
message_builder_spec.rb FEATURE: add support for One-Click unsubscribe (RFC 8058) 2024-12-31 15:28:59 +01:00
processor_spec.rb DEV: Don’t replace Rails logger in specs (#29721) 2024-11-13 08:47:39 +08:00
receiver_spec.rb FIX: correctly extract body and/or reply from exchange emails (#30512) 2024-12-31 15:29:36 +01:00
renderer_spec.rb DEV: Reset DiscoursePluginRegistry after spec (#25369) 2024-01-22 08:51:36 -06:00
sender_spec.rb DEV: deduplicate inline styles in emails (#30015) 2024-11-30 16:38:45 +01:00
styles_spec.rb DEV: deduplicate inline styles in emails (#30015) 2024-11-30 16:38:45 +01:00