- Getting unsrs
- Installing unsrs
- Using unsrs
- Contact information
What is unsrs?
unsrs checks incoming messages to see whether the envelope sender (return address) was rewritten with Meng Wong's broken Sender Rewriting Scheme (SRS). One example of a server using this scheme is Pobox.com.
What's the harm in SRS? There are various problems with it. One of the most important is that return addresses are used on the receiving end, and SRS breaks this. You might have an anti-spam challenge-response system. Or you might be running software that uses VERP to process bounces. These things and more require un-munged envelope senders.
Enter unsrs. unsrs removes the SRS-munging, turning the envelope address back into its original form. Simple as that.
Caveats
unsrs was not designed to remove all SRS munging. Instead, it's designed to watch for a particular host's munged addresses, and un-munge only them. In our above example, most of your email might come from Pobox.com, with their munging. unsrs will strip it back off. It can also be invoked more than once, to undo any number of hosts' SRS.
Similarly, unsrs removes exactly one "layer" of SRS. In theory, an email can pass through many hosts, each of which applies another layer of SRS mangling. Each time unsrs is invoked, it peels back exactly one layer.
Getting unsrs
unsrs was last modified on April 9, 2006. The current version is 0.13. You can download the latest version of unsrs from this site (about 250K).
Installation
cd /
tar xvzf unsrs-VERSION.tar.gz
cd package/host/jeenyus.net/unsrs-VERSION
./package/install
Observe that unsrs conforms to Dan Bernstein's slashpackage hierarchy.
Using unsrs
Once unsrs is installed, you must arrange for it to be called by qmail-smtpd instead of qmail-queue. It will examine the envelope sender and rewrite it, if necessary, passing the results on to qmail-queue. We assume that your version of qmail was compiled with Bruce Guenter's QMAILQUEUE patch.
Edit the script command/unsrs-qq and replace bounce2.pobox.com with the hostname that appears in your rewritten addresses.
Edit your qmail-smtpd's tcprules file, so the default rule looks like this:
:allow,QMAILQUEUE="/package/host/jeenyus.net/unsrs/command/unsrs-qq"
Monitor your SMTP logs for a while to ensure that no errors are occurring, and examine the raw headers of received messages to make sure that SRS-rewriting is indeed stripped from envelope senders.
By using some script other than unsrs-qq, you can achieve various effects. unsrs-qsq, for example, is useful if you use qscanq to virus-scan incoming messages.
Alternately, you can chain multiple invocations of unsrs, if you receive email from more than one host that uses SRS.
Contact
Send any patches, bugs, complaints, free beer, etc to me. Len Budney lbudney@pobox.com
