Postfix

From DreamHost

Jump to: navigation, search

Contents

Introduction

Postfix is a MDA like Exim or Sendmail which is the default on Ubuntu and Darwin (Mac) installations. Refer to this general guide to configure a Email relay if you get stuck.

Why do this? So you can perform simple and useful UNIXy commands from your terminal like:

cat log | mail -s "check this out" colleague@example.com

Finding which version of Postfix you are running

won$ postconf -d | grep mail_version                                                                                                                                                                           
mail_version = 2.1.5

Monitor your logs

tail -f /var/log/mail.log

Configure your laptop's Postfix to relay your email to Dreamhost to relay

mail.dreamhost.com should instead by mail.yourdomain.com

/etc/postfix/main.cf:

relayhost = [mail.dreamhost.com]
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/smtp_pass
smtp_sasl_security_options =

Keep in mind that some ISPs block the default smtp port. Therefor you must manually specify the alternate port available

relayhost = [mail.yourdomain.com]:587


You probably also want to ensure you have good values for:

myhostname = yourdomain.com
mydomain = yourdomain.com

/etc/postfix/smtp_pass:

mail.domain.com username:password

and do the following:

$ sudo postmap /etc/postfix/smtp_pass

This creates a /etc/postfix/smtp_pass.db for the hash

Finally:

 sudo postfix restart

And monitor to your logs to debug. Whilst firing off:

echo test | mail someone@gmail.com
Personal tools