Created
February 2, 2024 21:13
-
-
Save bk2204/b5112d7f2bea543266f2b050cbdd5367 to your computer and use it in GitHub Desktop.
A script to unsubscribe users from mailing lists
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Pipe an email to standard input and, if it supports RFC 8058 one-click unsubscribe, you will be automatically unsubscribed. | |
formail -c -x List-Unsubscribe | perl -pe 's!<https?://([^>]+)>!$1!' | \ | |
xargs curl -X POST -H'Content-Type: application/x-www-form-urlencoded' -dList-Unsubscribe=One-Click |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment