aboutsummaryrefslogtreecommitdiff
traclicker

traclicker

Introduction

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

Add to load-path and require.

(add-to-list 'load-path "~/.emacs.d/lisp/traclicker")
(require 'traclicker)

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:

(setq tracli-senders '("info@some-org.com"
		       "newsletter@another-org.com"))
(setq tracli-maildirs '("~/mail/Inbox" "~/mail/Archive"))

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

(tracli-scan
 (format "%d"
	 (- (string-to-number (format-time-string "%s" (current-time)))
	    (* 60 60 24 30))))

Alternatively, to do a symbolic scan of emails that just initialises an empty database with the current time stamp for future scans, do

(tracli-scan (format-time-string "%s" (current-time)))

You now have a database at tracli-db-file. You can then run tracli-scan periodically

(setq my-tracli-timer
	    (run-at-time
	     "07:00am"
	     86400 #'tracli-scan))

or as a hook after running say gnus-group-get-new-news

(add-hook 'gnus-after-getting-new-news-hook #'tracli-scan)

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 can be done automatically by setting tracli-url-rewriter. A package that specialises in such things and can help implement a url rewriter exists too ;)

Copyright and contact

tracklicker is maintained by Yuchen Pei <id@ypei.org> and covered by 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 ~ycp/gym@lists.sr.ht.