Web Content Display Ok, so I went ahead and played around with postfix to see if I could get it to forward the mail the way I wanted. This seems like a really bad idea on a true multi-user system, since I'm pretty sure it would let anybody on my box send mail as me simply by specifying my email address in the smtp envelope. There's an article on setting up two postfix instances to do smtp forwarding where the assumption is that each account on your box should be magically transformed into a single outgoing smtp account. I was able to glean a lot of info from it, but it wasn't quite what I wanted. I've got postfix 2.4.5-3ubuntu1. Docs suggest that I would have had less trouble with the TLS configuration in 2.5, but I didn't really feel like recompiling it. Set up sender-dependent relayingCreate sender_dependent_relayhost, which maps sender addresses to outgoing servers (don't forget postmap). # cat > /etc/postfix/sender_dependent_relayhost ryandjohnson@gmail.com [smtp.gmail.com]:25 ryan@innerfence.com [server1.gambitdesign.com]:25 # postmap sender_dependent_relayhost Require TLS for the relaysCreate smtp_tls_policy that requires TLS with valid certs for our relay hosts. In part this is necessary to guarantee that our passwords aren't sent in the clear, since gmail doesn't support anything else. # cat > /etc/postfix/smtp_tls_policy [smtp.gmail.com]:25 secure [server1.gambitdesign.com]:25 secure # postmap smtp_tls_policy Set up passwordsCreate sasl_password that configures your username/password for each host. # cat > /etc/postfix/sasl_password [smtp.gmail.com]:25 ryandjohnson@gmail.com:nopaste [server1.gambitdesign.com]:25 ryan@innerfence.com:nopaste # chmod 600 sasl_password # postmap sasl_password Fix TLS certificate validationWe need to link in the openssl roots and take the smtp client process out of chroot. This kind of sucks, but I didn't really see any other way to do it. # ln -s /etc/ssl/certs /etc/postfix/certs # $EDITOR /etc/postfix/master.cf -smtp unix - - n - - smtp +smtp unix - - - - - smtp Hook it all up in main.cf# $EDITOR /etc/postfix/main.cf + Fire it up, test it out# postfix reload # sendmail -f ryandjohnson@gmail.com -t ryan@innerfence.com From: ryandjohnson@gmail.com To: ryan@innerfence.com Subject: test message The quick brown fox jumps over the lazy dog. # tail /var/log/mail.log Be sure when you're testing it you view all the headers on the mail you receive, to ensure that you get domain key signatures, SPF passes, and all the other modern goodness which is really why you want to do it. |