#+title: traclicker #+author: Yuchen Pei * Introduction :PROPERTIES: :UPDATED: [2023-10-30 Mon 00:27] :END: A click tracker is a recipient-specific link in email newsletters which when clicked, registers the click with the sender's server and gets the real link through HTTP redirect (301/302). On top of the info that a server gains from a GET request like IP address and time of the request, the email sender's server can also identify the email recipient who clicked the link because each recipient receives a unique link, and there are few ways to defend against such identification. Click trackers are a violation of privacy regardless of how the sender of the email tries to justify it. This project, ~traclicker~ is a program that aims to mitigate the privacy risk from click trackers, by automatically sending a HEAD request to all links and collecting the real urls, and at the time when the recipient actually reads the mails, showing the real urls. * Usage :PROPERTIES: :UPDATED: [2023-10-30 Mon 00:26] :END: Add to ~load-path~ and ~require~. #+begin_src emacs-lisp (add-to-list 'load-path "~/.emacs.d/lisp/traclicker") (require 'traclicker) #+end_src Configure the maildir boxes (directories with =cur=, =new= and =tmp= sub-directories) and senders of emails you want to scan and replace click trackers with real links: #+begin_src emacs-lisp (setq tracli-senders '("info@some-org.com" "newsletter@another-org.com")) (setq tracli-maildirs '("~/mail/Inbox" "~/mail/Archive")) #+end_src You are ready for an initial scan now. To do an initial scan of all mails in these maildirs by these senders, do ~M-x tracli-scan~. To do an initial scan of emails from say the past 30 days, do the following #+begin_src emacs-lisp (tracli-scan (format "%d" (- (string-to-number (format-time-string "%s" (current-time))) (* 60 60 24 30)))) #+end_src Alternatively, to do a symbolic scan of emails that just initialises an empty database with the current time stamp for future scans, do #+begin_src emacs-lisp (tracli-scan (format-time-string "%s" (current-time))) #+end_src You now have a database at ~tracli-db-file~. You can then run ~tracli-scan~ periodically #+begin_src emacs-lisp (setq my-tracli-timer (run-at-time "07:00am" 86400 #'tracli-scan)) #+end_src or as a hook after running say ~gnus-group-get-new-news~ #+begin_src emacs-lisp (add-hook 'gnus-after-getting-new-news-hook #'tracli-scan) #+end_src Whenever you view a mail containing click trackers recorded in traclicker database, run ~M-x tracli-wash-gnus-article~ (by default bound to ~v t~ in gnus-summary-mode or gnus-article-mode), and all the click tracker urls are replaced by the real urls! Note that the real urls may still contain tracking query parts like utm parameters, but the cleaning of these urls is feasible by hand, and a package that does so automatically belongs to a separate project :D * Copyright and contact :PROPERTIES: :UPDATED: [2023-10-29 Sun 19:15] :END: ~tracklicker~ is maintained by Yuchen Pei and covered by [[https://www.gnu.org/licenses/agpl-3.0.en.html][GNU AGPLv3+]]. You may find the license text in a file named COPYING.agpl3 in the project tree. For comments, bug reports or patches, please use the mailing list [[https://lists.sr.ht/~ycp/gym][~ycp/gym@lists.sr.ht]].