mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 10:31:10 +08:00
FEATURE: IMAP delete email sync for group inboxes (#10392)
Adds functionality to reflect topic delete in Discourse to IMAP inbox (Gmail only for now) and reflecting Gmail deletes in Discourse. Adding lots of tests, various refactors and code improvements. When Discourse topic is destroyed in PostDestroyer mark the topic incoming email as imap_sync: true, and do the opposite when post is recovered.
This commit is contained in:
@ -13,7 +13,7 @@ class WebhooksController < ActionController::Base
|
||||
def sendgrid
|
||||
events = params["_json"] || [params]
|
||||
events.each do |event|
|
||||
message_id = (event["smtp-id"] || "").tr("<>", "")
|
||||
message_id = Email.message_id_clean((event["smtp-id"] || ""))
|
||||
to_address = event["email"]
|
||||
if event["event"] == "bounce"
|
||||
if event["status"]["4."]
|
||||
@ -150,7 +150,7 @@ class WebhooksController < ActionController::Base
|
||||
return mailgun_failure unless valid_mailgun_signature?(params["token"], params["timestamp"], params["signature"])
|
||||
|
||||
event = params["event"]
|
||||
message_id = params["Message-Id"].tr("<>", "")
|
||||
message_id = Email.message_id_clean(params["Message-Id"])
|
||||
to_address = params["recipient"]
|
||||
|
||||
# only handle soft bounces, because hard bounces are also handled
|
||||
|
Reference in New Issue
Block a user