Monday, 27 May 2013

How to Install and Deploy Home Email Server

Background

I have a headless PC running Centos 6.4. I want to copy the photos in my iPhone to the headless PC. iPhone allows the photos to be copied via email.

Objective

  • Install and deploy Postfix MTA/MDA
  • Add MX entry for private domain name

Prerequisite

Environment

  • Centos 6.4
  • SELinux is turned on

Procedure

  1. Install postfix

    #yum install postfix
  2. Configure postfix

    #vi /etc/postfix/main.cf:

    myhostname = mail.example.com
    mydomain = example.com
    myorigin = $mydomain
    inet_interfaces = all
    mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
    mynetworks = 192.168.0.0/24, 127.0.0.0/8
    relayhost =
    home_mailbox = Maildir/
  3. Start postfix service

    #service postfix start
  4. Let smtp packets through the firewall

    #iptables -I INPUT 2 -p tcp --dport 25 -m state --state NEW -j ACCEPT
  5. Add MX entry to zone file

    @ IN MX 10 mail.example.com.
  6. Add alias name mail.example.com for mail server

    mail            IN      CNAME   vaio

References:


No comments:

Post a Comment