Changes between Version 1 and Version 2 of faq/email/setup-postfix-debian

Dec 12, 2010, 4:27:01 PM (11 years ago)
Matthew James Goins



  • faq/email/setup-postfix-debian

    v1 v2  
    1 back in 15 minutes
     1= Hints for running postfix on a debian workstation/laptop =
     3Security Warning: this method requires you put your password in a file under /etc, and if you run verbose mail logs, your password might end up in the mail.log files as well. Please secure those files accordingly.
     5Some users may wish to run a full mail system on their personal machines. For systems running recent debian systems (these instructions were tested on squeeze), these hints should help get postfix up and running with mayfirst's mail relays.
     7This setup is likely to work with ubuntu, but at the time of writing it hasn't been tried.
     9These instructions all require root access to the machine in question.
     11== Installing the Software ==
     12First install postfix, making sure to include the suggest package for the sasl modules:
     15aptitude install libsasl2-modules postfix
     18You may have to uninstall some other MTA, such as exim or ssmtp. aptitude should tell you what's up.
     20=== Config Questions ===
     21You will be presented with an interactive prompt asking some questions.
     23First it will ask you to choose a type of system. I chose
     26internet site with smarthost
     31The next question is the mail name for you machine. Since my laptop already was set up with a fully-qualified domain name, I chose the default. Choosing a hostname may be beyond the scope of these instructions, but you should choose a name that resolves to some ip address (FIXME?)
     33Next, you'll be asked for the smarthost name. This is the same as your primary host as described on the [wiki:configure_email] page, and you can include a port. So for chavez, it's
     39Aptitude will then finish installing the packages.
     41== Configure Postfix ==
     43Edit the file /etc/postfix/
     45The default file should be sufficient as is, with the following additions (add them at the bottom)
     48smtp_sasl_auth_enable = yes
     49smtp_tls_security_level = encrypt
     50smtp_sasl_tls_security_options = noanonymous
     51smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
     54See `man smtp` for details on those configuration options.
     56Next, create a file called `/etc/postfix/sasl_passwd`, containing:
     58{{{           username:PASSWORD
     62Replacing username and PASSWORD with your credentials. When that file is saved, run the command
     65postmap /etc/postfix/sasl_passwd
     68Any time in the future that you change `/etc/postfix/sasl_passwd`, you will need to run `postmap` again.
     70== Dealing with User Agents ==
     72(this section needs work)
     74At this point you should have a working `/usr/bin/sendmail` on your machine, however, the envelopes around messages you send might contain strange information, such as `From:` set to the fully-qualified name of your laptop. This may result in mail you send being rejected by the mayfirst relay, depending on the domain you use for your laptop.
     76I work around this problem by telling mutt, my MUA of choice, to use my regular (mayfirst-provided) email address for the `From:` header. In my .muttrc, I include the lines
     79set envelope_from = yes
     80set from =
     81set use_from = yes
     84Substitute your email address above, and mutt should do the right thing.