Skip to content

Instantly share code, notes, and snippets.

@trackzero
Created October 19, 2014 18:46
Show Gist options
  • Save trackzero/6774619c128163689713 to your computer and use it in GitHub Desktop.
Save trackzero/6774619c128163689713 to your computer and use it in GitHub Desktop.
Using Amazon Linux, a clean install...
(from http://wiki.centos.org/HowTos/postfix)
(remember to sudo where appropriate, or "sudo su -" to run everything as root)
yum install postfix dovecot
yum remove sendmail
add/update the following in /etc/postfix/main.cf
myhostname = mail.YOURDOMAIN.COM
mydomain = YOURDOMAIN.com
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks = 192.168.0.0/24, 127.0.0.0/8
relay_domains =
home_mailbox = Maildir/
Add aliases:
sudo nano /etc/aliases
(edit the file as appropriate)
sudo newaliases
(loads the file)
add the following in /etc/dovecot.conf:
protocols = imap imaps pop3 pop3s
mail_location = maildir:~/Maildir
pop3_uidl_format = %08Xu%08Xv
# Required on x86_64 kernels
login_process_size = 64
then run:
chkconfig --level 345 dovecot on
/etc/init.d/dovecot start
/etc/init.d/postfix start
(use postfix reload if you ever change postfix conf)
Now stop the sendmail service and then start Postfix:
/etc/init.d/sendmail stop
/etc/init.d/postfix start
then I use mutt as a local mail client:
yum install mutt
add to ~/.muttrc:
set mbox_type=Maildir
set folder="~/Maildir"
set mask="!^\\.[^.]"
set mbox="~/Maildir"
set record="+.Sent"
set postponed="+.Drafts"
set spoolfile="~/Maildir"
set up your DNS records...
add an "A record" to mail.YOURDOMAIN.COM with the IP address.
add an MX record to @, or if using Route53, leave the name field blank. Value is:
10 mail.YOURDOMAIN.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment