Table of Contents

Secure remailer

Secure remailer
founder: ruza
depends on:
software license: -
hardware license: -


We have an contact email where people can send sensitive info. We dont want to transfer such info unsecurely nor have stored anywhere where can be leaked later. This email addres is actually an alias whose membership is changing overtime. Only actual final recipients (ie brmlab council members) should be able to decrypt such email.

recipient changes GPG keys
contact email practically none brmlab GPG
actual recipients changes once a year or so bunch of final recipients keys


Sender encrypts an email against Brmlab public GPG key. Email is delivered to an brmlab SMTP server, reencrypted by GPG-remailer to an up-to-date list of recipients (that is changed more frequently than contact email) and resent to them. Only actual and specific members can decrypt such message with his/her own private key.

GPG for contact email has been generated: Brmlab GPG key

All email aliases that should be reencrypted are directed to one OS user:

confidential: secmail
join:           secmail

Per user delivery using procmail:


Each email alias has an own configuration file for GPG-remailer.

logfile: remailer.log
loglevel: 0
debug: true
nomail: false 
replyto: <>
clear-text: rejected       
signature:  absent
recipient: members

Corŕect configuration file is chosen by procmail parsing mechanism. Here we are also generating reject messages if messages seems to be not encrypted.

SUBJECT=`formail -x Subject:`
TO=`formail -x To: `
FROM=`formail -x From:`
# copy of all incoming emails for debugging purposes
        * !(-----(BEGIN|END) PGP MESSAGE-----)
        | formail -I "Subject: [unencrypted and not delivered to $TO]$SUBJECT"
# rejects all non-encrypted emails
        * !(-----(BEGIN|END) PGP MESSAGE-----)
        | ( formail -r -a "X-Brm: Rejected from $TO";\
        echo "This is an auto-generated reply.";\
        echo " ";\
        echo "Your e-mail";\
        echo "To: $TO";\
        echo "Subject:$SUBJECT ";\
        echo " ";\
        echo "was REJECTED and NOT DELIVERED because";\
        echo "this address accepts GnuPG ENCRYPTED emails only.";\
        echo " ";\
        echo "SEND your email AGAIN:";\
        echo " 1) encrypted by GPG/PGP ( to $TO or";\
        echo " 2) unencrypted to";\
        echo " ";\
        echo "Or You can ask for help at";\
        echo ""; ) | /usr/sbin/sendmail -t -oi -f "$TO"
# gpg-remailer drops original From, so its added by this filter to Subject
:0 cfw
        | formail -I "Subject: [$FROM] $SUBJECT"
# re-encrypt email
        * ^(To|Cc|Bcc):.**
        | /usr/bin/gpg-remailer /var/lib/secmail/.gpg-remailer-secmail
        * ^(To|Cc|Bcc):.**
        | /usr/bin/gpg-remailer /var/lib/secmail/.gpg-remailer-secmail
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 4.0 International
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki