discourse/lib/email
Régis Hanol d7aa13328d
FIX: strip unsubscribe links in incoming emails (#30695)
When we send an email notification to a user, we always include a link
that will allow them unsubscribe to these emails.

If the user reply to the email notification, the link to unsubscribe
might still be present in the final post (often in the elided part).

Since those links do not require authentication to unsubscribe a user
(this is a feature, not a bug), we would like to avoid showing them to
other users on Discourse.

(If such an email is forwarded elsewhere, then it's totally out of our
control.)

This commmit ensures we always strip those unsubscribe links from any
incoming email to avoid making it easier to unsubscribe another user.

Since the format we use for those links might be similar to the ones
used by other applications, the regular expression used to match those
links uses the absolute URL of the Discourse (aka.
`Discourse.base_url`).
2025-01-13 11:33:46 +01:00
..
authentication_results.rb DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
build_email_helper.rb DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
cleaner.rb DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00
message_builder.rb FEATURE: add support for One-Click unsubscribe (RFC 8058) 2024-12-31 15:28:59 +01:00
message_id_service.rb DEV: Remove old TODOs for message-id formats (#27196) 2024-05-28 13:57:09 +10:00
poller.rb FEATURE: Add hooks for email poller plugins (#21384) 2023-06-26 13:16:03 +08:00
processor.rb FIX: Prevent Email Processor errors when mail is blank or nil (#21292) 2023-05-18 10:39:37 +08:00
receiver.rb FIX: strip unsubscribe links in incoming emails (#30695) 2025-01-13 11:33:46 +01:00
renderer.rb DEV: Add apply_modifier in Email::Renderer for html modifications (#25205) 2024-01-12 09:14:55 -06:00
sender.rb DEV: update base url links to respect subfolder installs (#27740) 2024-07-09 12:42:38 +04:00
styles.rb Revert "DEV: prioritize new email styles over existing, to make customization easier (#30244)" (#30297) 2024-12-16 11:16:17 +00:00
validator.rb DEV: Apply syntax_tree formatting to lib/* 2023-01-09 12:10:19 +00:00