[wiki:howto <- Back to the HOWTO section] = How to set-up Postfix = * Audience: Advanced E-Mail set-up * Requires: MacPorts >= 1.6, mail/postfix, shells/zsh-devel == Introduction == This How-to is part of the [wiki:howto/SetupFetchmail Fetchmail] -> [wiki:howto/SetupPostfix Postfix] -> [wiki:howto/SetupDovecot Dovecot] advanced e-Mail set-up. [wikipedia:Postfix_%28software%29 Postfix] is a [wikipedia:Mail_transfer_agent mail transfer agent] which can distribute you in and outbound mail. The set-up described here will distribute inbound mail to [wikipedia:Dovecot_%28software%29 Dovecot] [wikipedia:Internet_Message_Access_Protocol IMAP] server and outbound mail to an [wikipedia:Internet_service_provider internet service provider]. Distribution E-Mail directly to the end receiver is one of the joys of the internet which has been destroyed by [wikipedia:E-mail_spam SPAM]. == Installation == First set-up a mail storage to store your mail into. See [wiki:howto/SetupDovecot Dovecot] for a possible set-up. Without a proper mail storage you might have difficulty access you mail later. === Z-Shell === Install Z-Shell if you are planning to use the attached command files: {{{ sudo port install zsh-devel }}} === Postfix === Install postfix with: {{{ port install postfix +tls +ldap }}} or - alternatively - use the postfix which comes pre installed with Max OSX. == Configuration == Most of the postfix configuration is done in the [attachment:main.cf] file which you find either in {{{/opt/local/etc/postfix}}} (macports) or {{{/etc/postfix}}} (OSX). === Step 1: '''setup main.cf''' === ==== set hostname and domain ==== Search for {{{my_computer}}} and {{{my_domain}}} in {{{main.cf}}} and replace them with the domain name and computer name of your computer. You can find them out with the {{{hostname}}} command. The following lines need attention: {{{ myhostname = my_computer.local mydomain = my_domain.com mydestination = localhost,localhost.my_domain.com,my_computer,my_computer.local,my_computer.my_domain.com masquerade_domains = my_domain.com }}} Note: if you don't use an domain name apart from {{{.local}}} then you can remove the duplicate. ==== set relayhost ==== Your outbound mail needs to go to a relayhost as most of us can't send e-mail directly any more. My relayhost is {{{smtp.my_domain.com}}} this does not need to be for you. The following lines need attention: {{{ relayhost = [smtp.my_domain.com] }}} ==== /usr <-> /opt/local ==== Depending on which version of postfix (osx vs. macports) you use you have to change all lines containing {{{/usr}}} to {{{/opt/local}}}. ==== /private <-> /opt/local ==== Depending on which version of postfix (osx vs. macports) you use you have to change all lines containing {{{/private}}} to {{{/opt/local}}}. === Step 2: '''setup relay passwords''' === TODO === Step 3: '''starting the daemon''' === [attachment:Restart_Postfix.command] === Step 4: '''testing the deamon''' === The attached [attachment:Test_Postfix.command] will send a test e-mail to your self - provided you replaced {{{my_name}}} and {{{my_computer}}} with your own name and computer name. == Optional Parts == === '''TODO: What else can be done?''' === [wiki:howto <- Back to the HOWTO section]