您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
Timo Röhling 6c1da85137 Remove strict error checking from Red Hat init script 10 年前
.gitignore Ignore Eclipse project files 11 年前
.travis.yml Fix Travis CI script 11 年前
CMakeLists.txt Add Red Hat-style init script 10 年前
LICENSE Initial commit 12 年前
README.md Update README.md 11 年前
main.cf.ex Update main.cf.ex 11 年前
makefile Initial commit 12 年前
postinstall.cmake.in Fix #3 again 10 年前
postsrsd.apparmor.in Add AppArmor support 12 年前
postsrsd.c Check for extra command line arguments 10 年前
postsrsd.default Optionally exclude domains from address rewriting 11 年前
postsrsd.lsb_init.in Add Red Hat-style init script 10 年前
postsrsd.rh_init.in Remove strict error checking from Red Hat init script 10 年前
postsrsd.upstart.in Optionally exclude domains from address rewriting 11 年前
sha1.c Initial commit 12 年前
srs2.c Initial commit 12 年前
srs2.h Initial commit 12 年前

README.md

About

PostSRSd provides the Sender Rewriting Scheme (SRS) via TCP-based lookup tables for Postfix. SRS is needed if your mail server acts as forwarder.

Imagine your server receives a mail from alice@example.com that is to be forwarded. If example.com uses the Sender Policy Framework to indicate that all legit mails originate from their server, your forwarded mail might be bounced, because you have no permission to send on behalf of example.com. The solution is that you map the address to your own domain, e.g. SRS0+xxxx=yy=example.com=alice@yourdomain.org (forward SRS). If the mail is bounced later and a notification arrives, you can extract the original address from the rewritten one (revere SRS) and return the notification to the sender. You might notice that the reverse SRS can be abused to turn your server into an open relay. For this reason, xxxx and yy are a cryptographic signature and a time stamp. If the signature does not match, the address is forged and the mail can be discarded.

Building

PostSRSd requires a POSIX compatible system and CMake to build. Optionally, help2man is used to create a manual page.

For convenience, a Makefile fragment is provided which calls CMake with the recommended command line options. Just run make.

Installing

Run make install as root to install the daemon and the configuration files.

Configuration

The configuration is located in /etc/default/postsrsd. You must store at least one secret key in /etc/postsrsd.secret. The installer tries to generate one from /dev/urandom. Be careful that no one can guess your secret, because anyone who knows it can use your mail server as open relay! Each line of /etc/postsrsd.secret is used as secret. The first secret is used for signing and verification, the others for verification only.

PostSRSd exposes its functionality via two TCP lookup tables. The recommended Postfix configuration is to add the following fragment to your main.cf:

sender_canonical_maps = tcp:127.0.0.1:10001
sender_canonical_classes = envelope_sender
recipient_canonical_maps = tcp:127.0.0.1:10002
recipient_canonical_classes= envelope_recipient

This will transparently rewrite incoming and outgoing envelope addresses. Run service postsrsd start and postfix reload as root, or reboot.