Gmail automated unsubscribe emails - How to stop them? - email

When a user unsubscribes from an email in gmail, it seems gmail sends an email to the sender with:
`subject`: "unsubscribe"
`body`: "This message was automatically generated by Gmail."
`to`: u+(somesuperlongrandomstring)#domain.tld
`from`: (Email of user who unsubscribed)
Similarly, when a user unsubscribes from an email in Apple Mail, it seems Apple Mail sends an email to the sender with:
`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
We use mailgun to handle unsubscribes already, but as of 28th March 2022, these emails from both providers now make it through our email routing.
Does anyone know how to tell gmail or Apple Mail to not send these emails? They are redundant because mailgun is already handling the unsubscribe using the list-unsubscribe header as you'd expect.
Alternatively, does anyone know how to set up Mailgun so these messages aren't passed through routes?

So Mailgun didn't provide any help, sadly. But looking through their documentation, and the headers of these emails, it seems possible to use their Routes to hide the emails completely.
The three clues are:
Emails always coming in the format u+(...)#domain.tld
Gmail unsubscribes always have the subject "unsubscribe"
Apple Mail unsubscribes always have the header: X-Apple-Unsubscribe:true
As such, you can create a route as such to capture and discard these emails using a custom route with the raw expression set to:
match_recipient("u\+(.*)#domain.tld") and (match_header("X-Apple-Unsubscribe", "true") or match_header('subject', 'unsubscribe'))
It's sad that Mailgun stopped doing this themselves, but at least there is a solution with their tooling!

Related

Verification email not received by domains using Office365 email client

When someone signs up they receive an email with a link they need to click to verify their email. The email comes from no_reply#domain.com
So far all clients receive this email with the exception of clients using their own domain with Office365. With these clients it's not an issue of emails going to spam - they don't receive anything at all in either their spam or their inbox.
The email is sent from a domain that uses Google Business for email.
Any ideas how to solve this issue?
I should add that if the email is forwarded manually, it does come through, just not when automatically sent.

Auto Replies going back to Sendgrid

We are using sendgrid to send emails via SMTP. Sendgrid attached the return-path header to the outgoing emails so that bounces go back into sendgrid. However if a user has vacation emails set up they are being returned to the return-path. Do we have any way of capturing the emails somehow in Sendgrid? It appears the web hooks for bounces do not capture the auto replies and they do not appear anywhere.

Allow replying-to dynamic local-part of address sent by sendgrid

I have user in my system who can send emails through my API. The API uses SendGrid to send the emails with their username as the sender + reply-to address.
user_1#mydomain.com
user_2#mydomain.com
user_3#mydomain.com
What I would like to do is allow people to reply to these emails but I'm unsure how to do this.
Obviously if I try to reply as is - I get an error saying the email couldn't be delivered.
Is there something to do with SendGrid which can handle previously unseen addresses #mydomain.com or do I need to do something to set them up initially in the first place?
The solution was to use incoming web-hooks.

Sendgrid - Activity says email delivered but email not received

I tried to send an email through sendgrid. I have a custom domain myself#contoso.com. If i try to send an email to user1#gmail.com with the from address as myself#contoso.com,then,the email is delivered to gmail with "via". When i try sending email to myself#contoso.com with the from address being myself#contoso.com the activity says the email is delivered however, in outlook client i have not received the email. What is it that I can try or do?
I have tried whitelisting contoso.com but it did not work
This is not an answer, as it doesn't help work out why the emails that are "Delivered" have not been received, but this is SendGrid's note on why Email messages with the “Delivered” status are not received:
Twilio SendGrid posts the Delivered event after the destination server accepts the message with a 250 OK response. Once an email is accepted by the destination server, we are unable to see what happens to the message. The receiving server could send it to the inbox, queue it for later delivery, put it into the spam folder, etc.
Often times, a recipient domain will initially accept a message for delivery, and then apply additional filtering afterwards. In this situation, we would have posted the Delivered event, but not have any insight into the additional filtering. Any additional Twilio SendGrid events for your email message would be triggered by recipient engagement (i.e. open/click events, unsubscribes, etc.).
Also note that at the time of writing, that answer had 26 downvotes (and zero upvotes) on the SendGrid website, probably indicating that many other users have experienced this problem.
I had several issue solving this problem. The most important part is to set "Sender Authentication" from sendgrid to your domain dns. There is a instruction here. I'm using godaddy, so the link to set dns is https://dcc.godaddy.com/manage//dns .

Email "reply-to" is being ignored in favour of "from"

We have an app that sends emails on behalf of our clients. All emails are sent via Sendgrid. As part of this we have verified our email sending domains via DKIM and SPF.
When our clients send email, it is constructed as follows:
from: Tom Smith <email-service#ourserver.com>
reply-to: tom.smith#email.com
This works in the vast majority of cases, but there are situations where the "reply-to" is not being respected - recipients are clicking "Reply" in their email clients and the reply is coming back to us.
Is there something that we are missing here. Do we need to explicitly set a FROM or SENDER header? Or something else?