#!/bin/bash
#To use run "mixnotify.sh recipient" where recipient is the email address (or email to sms gateway) of the recipient
command -v mixmaster >/dev/null 2>&1 || { sudo sh -c "apt-get -qq install mixmaster ; torify mixmaster-update" ; mixmaster --update-pinger-list ; }
echo "someone is trying to communicate with you on a safer channel" | mixmaster --verbose --copies=1 --chain=*,*,* --to=$1 --subject="spidey sense"

#Note: a header of "From: amnesia@amnesia" is leaked to the tor hidden service SMTP relay (gbhpq7eihle4btsn.onion) and to the first node in the mixmaster circuit, but does not propagate past this initial injection into the mix network nor out of the mix network to the clearnet nor to the final email recipient. I believe some text needs to go here, so it's not a question of plugging the leak as much as whether some other "user@host" string would be better than "amnesia@amnesia" or not. 
