This is a very simple milter in Python using pymilter that rejects any non-PGP mail.
Milters are a way to reject or modify mail before it goes into the mail queue. This is useful because it lets me bounce spam to its real sender, not the forged from-address on the mail, so I don't become part of the backscatter problem.
MTAs that support milters include Sendmail, Postfix, and qpsmtpd.
This milter is part of a concept that requires mailservers to only accept PGP mail. I have no idea what you might want to use it for. It looks for a PGP header in the body of a mail and once it finds one, it will ACCEPT the mail. After 5000 characters into scanning the body, all mail is REJECTed. Actually it might scan some more because pymilter reads the mail body in possibly larger chunks.
PGPMilter is preconfigured for Postfix, but can be easily altered to be used with other MTAs. Possibly, the only thing you need to change is the CHUID in its initscript.
Requires: Python, python-milter
To install, run chmod +x install.sh && ./install.sh
- copies initscript to /etc/init.d/pgpmilter
- copies pgpmilter.py to /usr/local/bin
- creates rc.d symlinks
- runs /etc/init.d/pgpmilter
add to /etc/postfix/main.cf:
smtpd_milters = unix:/milter/pgpmilter.sock
milter_default_action = tempfail
PGPMilter is preconfigured for Postfix, but can be easily altered to be used with other MTAs. Possibly, the only thing you need to change is the CHUID in its initscript.
Backscatter is when spam sent from a forged From
address gets
bounced back to that address, effectively turning the spam's first
recipient into an inadvertent spam source. To avoid creating
backscatter, don't bounce mail after accepting it; instead, refuse the
mail at SMTP-time.
git clone git://github.com/moba/pgpmilter.git
or download the latest zip
https://github.com/moba/pgpmilter/zipball/master
The documentation and install script is based on minimilter, https://github.com/kragen/minimilter