SRS / Sender Rewriting when forwarding mail through postfix

Solution 1:

Here are the steps to install postsrsd from Timo Röhling. These instructions seem to work for many Unix flavors including Ubuntu 14.04.

# Debian/Ubuntu preparations:
sudo apt-get install cmake sysv-rc-conf

# download and compile the software:
cd ~
wget https://github.com/roehling/postsrsd/archive/master.zip
unzip master
cd postsrsd-master/
make
sudo make install

# or alternatively install binary from later Ubuntu repositories
sudo apt-get install postsrsd

# Add postfix configuration parameters for postsrsd:
sudo postconf -e "sender_canonical_maps = tcp:127.0.0.1:10001"
sudo postconf -e "sender_canonical_classes = envelope_sender"
sudo postconf -e "recipient_canonical_maps = tcp:127.0.0.1:10002"
sudo postconf -e "recipient_canonical_classes = envelope_recipient"

# Add SRS daemon to startup (Red Hat 6/CentOS):
sudo chkconfig postsrsd on
# Add SRS daemon to startup (Debian/Ubuntu):
sudo sysv-rc-conf postsrsd on
# Start SRS daemon:
sudo service postsrsd restart
#Reload postfix:
sudo service postfix reload

Solution 2:

There's a 2012 tutorial here on setting up SRS with Postfix on Debian: http://blog.phusion.nl/2012/09/10/mail-in-2012-from-an-admins-perspective/

Here's a 2013 tutorial for Ubuntu: http://www.ameir.net/blog/archives/71-installing-srs-extensions-on-postfix-ubuntudebian.html