mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 07:23:40 +08:00
e3d495850d
See https://meta.discourse.org/t/discourse-email-messages-are-incorrectly-threaded/233499 for thorough reasoning. This commit changes how we generate Message-IDs and do email threading for emails sent from Discourse. The main changes are as follows: * Introduce an outbound_message_id column on Post that is either a) filled with a Discourse-generated Message-ID the first time that post is used for an outbound email or b) filled with an original Message-ID from an external mail client or service if the post was created from an incoming email. * Change Discourse-generated Message-IDs to be more consistent and static, in the format `discourse/post/:post_id@:host` * Do not send References or In-Reply-To headers for emails sent for the OP of topics. * Make sure that In-Reply-To is filled with either a) the OP's Message-ID if the post is not a direct reply or b) the parent post's Message-ID * Make sure that In-Reply-To has all referenced post's Message-IDs * Make sure that References is filled with a chain of Message-IDs from the OP down to the parent post of the new post. We also are keeping X-Discourse-Post-Id and X-Discourse-Topic-Id, headers that we previously removed, for easier visual debugging of outbound emails. Finally, we backfill the `outbound_message_id` for posts that have a linked `IncomingEmail` record, using the `message_id` of that record. We do not need to do that for posts that don't have an incoming email since they are backfilled at runtime if `outbound_message_id` is missing. |
||
---|---|---|
.. | ||
20210513125608_remove_length_constrain_from_topic_excerpt.rb | ||
20210525112226_remove_length_constrain_from_topic_link_url.rb | ||
20210528003603_fix_badge_image_avatar_upload_security_and_acls.rb | ||
20210621234939_backfill_email_log_topic_id.rb | ||
20210624023831_remove_highest_seen_post_number_from_topic_users.rb | ||
20210628035905_drop_duration_column_from_topic_timers.rb | ||
20210706091905_drop_disable_jump_reply_column_from_user_options.rb | ||
20210709053030_drop_uploads_verified.rb | ||
20210802131421_remove_post_processed_trigger_option.rb | ||
20210909041448_make_topic_id_nullable_for_bookmarks.rb | ||
20210922064213_alter_bumped_at_indexes_on_topics.rb | ||
20211019152356_populate_pending_posts_count_column.rb | ||
20211124161346_queue_internal_onebox_rebake.rb | ||
20211201221028_migrate_email_to_normalized_email.rb | ||
20211206160212_drop_token_from_email_tokens.rb | ||
20211224010204_drop_old_bookmark_columns.rb | ||
20220202223955_migrate_selectable_avatars_enabled.rb | ||
20220214224506_reset_custom_emoji_post_bakes_version_secure_fix.rb | ||
20220215015538_drop_user_stat_count_constraints.rb | ||
20220220234155_conform_bounce_error_code.rb | ||
20220302171443_rebake_old_avatar_service_urls.rb | ||
20220309132720_copy_post_uploads_to_upload_references_for_sync.rb | ||
20220325064954_make_some_bookmark_columns_nullable.rb | ||
20220401140745_drop_category_required_tag_group_columns.rb | ||
20220429164301_delete_hotlinked_image_custom_fields.rb | ||
20220512011531_backfill_polymorphic_bookmarks.rb | ||
20220617151846_rename_default_categories_regular_setting.rb | ||
20220621164914_drop_flair_url_from_groups.rb | ||
20220825005115_backfill_outbound_message_id.rb |