I'd like to provide a single-click "Unsubscribe" links in the footer of the emails my service sends.
Obviously, many spam scanners will scan emails, and will follow any links found in the emails to scan their contents for malware. A workaround I have used so far:
- If the "Unsubscribe" page is requested via HTTP GET, it renders a simple confirmation form and a bit of JS that submits the form on page load
- If the "Unsubscribe" page is requested via HTTP POST then we unsubscribe the user
This way, the user will usually only need a single click on the form and they will get a "You have been unsubscribed" message. If they have JS disabled, they can still manually submit the confirmation form.
Now the problem is, some scanners like Office365's ATP will open the pages, and execute JS inside them. By executing JS they submit the form and cause user to be auto-unsubscribed.
I've considered adding checks to the auto-submit JS logic:
- don't auto-submit for specific user agents
- don't auto-submit for specific client IP ranges
- trigger the auto-submit on mouse move event
But these all seem like brittle methods, hacks at best, that are bound to break as email scanners change their tactics.
I'm sure this problem has bit many people before me. Are there known reasonable workarounds, aside from just giving up the single-click functionality?
PS. I have added support for RFC 8058 but users are still going to click links in the footer.