Privacy Tools Guide

How to Use Tor With Encrypted Email for Maximum Sender Anonymity

When your threat model requires hiding both the content and the identity of email senders, combining Tor network routing with end-to-end encryption provides defense in depth. This guide covers the technical implementation for developers and power users who need strong sender anonymity beyond what standard encrypted email provides.

Understanding the Anonymity Stack

Email sender anonymity involves hiding multiple identifiers: your IP address, your email provider account, and any links between your identity and the message. Tor masks your IP address by routing traffic through three or more relays, but metadata still reveals information to email providers and observers.

End-to-end encryption with PGP protects message content but does not hide sender metadata. Combining Tor with encrypted email creates layered protection: Tor hides your IP address and network fingerprint, while PGP encryption ensures only the intended recipient reads the content.

The critical insight is that you need both layers. Using encrypted email without Tor still reveals your IP address to mail servers. Using Tor without encryption allows observers to read message content at exit nodes.

Setting Up Tor for Email Traffic

You have two primary options for routing email through Tor: the Tor Browser’s built-in SOCKS proxy or the Tor daemon with a SOCKS port.

Using Tor Browser’s SOCKS Proxy

Tor Browser exposes a SOCKS5 proxy on 127.0.0.1:9150. Configure your email client to use this proxy for outgoing mail connections.

In Thunderbird, navigate to Account Settings > Outgoing Server (SMTP) and add a new server configuration:

SMTP Server: mail.example.com
Port: 465
Connection Security: SSL/TLS
Authentication Method: Normal password
Username: your-email@provider.com
SOCKS Host: 127.0.0.1
SOCKS Port: 9150

Test the connection by sending a test message. Monitor the Tor Browser circuit display to confirm traffic routes through Tor.

Using Tor Daemon for System-Wide Routing

For applications that don’t support SOCKS proxies directly, install the Tor daemon:

# macOS
brew install tor

# Debian/Ubuntu
sudo apt install tor

# Start tor daemon
tor &

The daemon exposes a SOCKS proxy on 127.0.0.1:9050. Configure your system or application to route mail traffic through this proxy.

Connecting to Email Providers via Onion Services

Onion services provide direct encrypted connections to email servers without exiting to the clearnet. This eliminates the risk of traffic analysis at Tor exit nodes.

ProtonMail Onion Service

ProtonMail operates an onion service at protonmailrmez3lot.onion. Configure Thunderbird to connect via this address:

Incoming Server: protonmailrmez3lot.onion
IMAP Port: 1143
SMTP Server: protonmailrmez3lot.onion
SMTP Port: 1025
Connection Security: STARTTLS

Note that the ProtonMail onion service requires you to use their bridge for full functionality. The bridge connects to their servers through Tor while providing standard IMAP access.

Custom Onion Service for Self-Hosted Email

If you run your own mail server, create an onion service to allow Tor-only access:

# Add to /etc/tor/torrc
HiddenServiceDir /var/lib/tor/mail_onion
HiddenServicePort 25 127.0.0.1:25
HiddenServicePort 587 127.0.0.1:587
HiddenServicePort 993 127.0.0.1:993

Restart Tor and retrieve your onion address:

sudo systemctl restart tor
sudo cat /var/lib/tor/mail_onion/hostname

This generates a .onion address that accepts connections only from the Tor network.

Implementing PGP Encryption

With Tor hiding your network identity, add PGP encryption to protect message content from end-to-end.

Generating a Dedicated Anonymity Key

Create a separate PGP key for anonymous communications—this prevents linking messages to your primary identity:

gpg --full-generate-key
# Select:
# - RSA and RSA (default)
# - 4096 bits
# - Key does not expire
# - Enter a pseudonym name and anonymous@onionmail.local

Export only the public key for sharing:

gpg --armor --export anonymous@onionmail.local > anonymity-key.asc

Never use this key from your primary machine or IP address.

Encrypting Emails Programmatically

For developers integrating PGP encryption into applications:

from gnupg import GPG

gpg = GPG(gnupghome='/path/to/anonymous/keys')

def encrypt_message(recipient_key, plaintext):
    """Encrypt message for recipient without revealing sender."""
    encrypted = gpg.encrypt(
        plaintext,
        recipients=[recipient_key],
        sign=False,  # Don't sign - reveals identity
        always_trust=True
    )
    return str(encrypted)

# Usage
message = "Your anonymous message here"
encrypted = encrypt_message("recipient@example.com", message)

The critical practice: never sign messages when sender anonymity is required. Digital signatures link messages to your key, defeating the anonymity provided by Tor.

Operational Security Considerations

Technical configuration alone doesn’t guarantee anonymity. Your operational practices determine overall security.

Timing Attacks

Even with Tor, message timing reveals information. Send messages at irregular intervals rather than predictable schedules. Batch outgoing messages and send them at random intervals to prevent traffic analysis.

Metadata Discipline

Avoid including any identifying information in message headers or body. This includes:

Separate Identities

Create completely separate environments for anonymous communications:

Verifying Your Setup

Test that your configuration actually provides the anonymity you expect:

  1. IP Leak Test: Visit a site like ip.me from your email client to confirm it shows a Tor exit node IP, not your real address.

  2. Onion Service Test: Verify you can connect to email provider onion services without errors.

  3. Encryption Verification: Send a test message and confirm it’s encrypted by examining the raw SMTP transaction:

nc -C mail.provider.com 25
EHLO test
STARTTLS
# Verify TLS negotiation succeeds
  1. Metadata Inspection: Check email headers of sent messages to ensure no revealing information leaks through.

Common Pitfalls to Avoid

Several mistakes undermine the anonymity these tools provide:

Built by theluckystrike — More at zovo.one