| Name | Last modified | Size | |
|---|---|---|---|
| Parent Directory | - | ||
| configure-postfix-for-gmail.sh | 14-Sep-2010 13:23 | 2.0K | |
| sendmail-with-envelope-sender-set-from-headers | 27-Jan-2010 03:58 | 601 | |
| create-ca-and-cert.sh | 25-Jan-2010 17:06 | 1.3K | |
| README.html | 25-Jan-2010 13:29 | 4.6K | |
| link-backup/ | 25-Jan-2010 13:25 | - | |
Google's gmail supports sending mail with any "From:" header and envelope sender (aka "return address") which you have proved that you own. (Here are instructions.) This works through the web client, but it is also possible to route such messages through gmail's SMTP servers, which means it's possible to set up postfix to route all your mail through gmail's SMTP servers, as long as you go through the process to prove ownership of each return address that you use beforehand. The point of doing this, rather than just delivering mail directly, is that gmail's servers have what I call a "respectable" reverse DNS record -- as opposed to us internet riffraff, with our "suspicious" reverse DNS records containing multiple layers of subdomains, and unseemly strings such as "adsl" or "dyn". The end result is that, by routing your mail through gmail, you will find your messages much less likely to end up in "spam" boxes.
This page contains shell scripts that will configure your Debian postfix installation to deliver mail through gmail for the specified accounts. Specifically, without prompting for anything, the scripts will:
/etc/postfix/ssl/demoCA//etc/postfix/ssl//etc/postfix/sasl_passwd to hold your gmail accounts and passwords/etc/postfix/sender_dependent_relayhost_map to specify where outgoing mail with "sender" matching your gmail account should be routed (i.e., through gmail)/etc/postfix/tls_per_site where gmail is specified as TLS-only/etc/postfix/main.cf to configure postfix to use the above-mentioned files and to have the right settings for gmailBefore you run them, you need to edit the environment values at the top of the scripts. Actually, all you really need to edit is the value of ACCOUNTS in configure-postfix-for-gmail.sh; if you do that, everything should work. If you don't, you will have to edit /etc/postfix/sasl_passwd and /etc/postfix/sender_dependent_relayhost_map to use your gmail account(s) and sender address(es) instead of mine, and your password instead of the word "SECRET".
Also, here is a sendmail wrapper that will set an email's envelope sender (which is used by postfix to determine whether to deliver through gmail) based on the email's "From:" header. I use this in mutt so that I can change the address just by editing the "From" field in that client. It would work with any other email client that you can make use the wrapper instead of the real sendmail.
In order to use it, I saved the wrapper in a directory listed in my $PATH added the line
set sendmail=sendmail-with-envelope-sender-set-from-headers
to my .muttrc. If you are using mutt, you might also want to see this page: Profiles with Mutt. The approach described there could either complement or replace the use of my wrapper script.
Some day, perhaps, I will unify these two scripts, make them prompt for missing values rather than force the user to edit environment variables, and edit the configuration using a function that checks for existing values using "postconf" (so that the script does not depend on scanning comments to be idempotent, and so that it does not end up clobbering any non-default changes by the user). Then I might put them in a .deb...