當用戶在 gmail 中取消訂閱電子郵件時,似乎 gmail 會向發件人發送一封電子郵件,其中包含:
`subject`: "unsubscribe"
`body`: "This message was automatically generated by Gmail."
`to`: u (somesuperlongrandomstring)@domain.tld
`from`: (Email of user who unsubscribed)
同樣,當用戶取消訂閱 Apple Mail 中的電子郵件時,Apple Mail 似乎會向發件人發送一封電子郵件,其中包含:
`subject`: (blank)
`body`: Apple Mail sent this email to unsubscribe from the message "(Subject of email unsubscribed from)".
`to`: u (somesuperlongrandomstring)@domain.tld
`from`: Email of user who unsubscribed
我們已經使用 mailgun 處理取消訂閱,但截至 2022 年 3 月 28 日,來自兩家提供商的這些電子郵件現在通過我們的電子郵件路由發送。
有誰知道如何告訴 gmail 或 Apple Mail 不要發送這些電子郵件?它們是多余的,因為 mailgun 已經list-unsubscribe按照您的預期使用標頭處理取消訂閱。
或者,有誰知道如何設定 Mailgun,這樣這些訊息就不會通過路由傳遞?
uj5u.com熱心網友回復:
遺憾的是,Mailgun 沒有提供任何幫助。但是查看他們的檔案以及這些電子郵件的標題,似乎可以使用他們的路由來完全隱藏電子郵件。
這三個線索是:
- 電子郵件始終采用 u (...)@domain.tld 格式
- Gmail 取消訂閱的主題始終是“取消訂閱”
- Apple Mail 取消訂閱總是有標題:
X-Apple-Unsubscribe:true
因此,您可以創建一個路由來捕獲和丟棄這些電子郵件,并使用custom route以下raw expression設定:
match_recipient("u (.*)@domain.tld") and (match_header("X-Apple-Unsubscribe", "true") or match_header('subject', 'unsubscribe'))
遺憾的是 Mailgun 自己停止了這樣做,但至少他們的工具有一個解決方案!
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/461067.html
