さくらVPSでメールサーバ(Postfix)の設定



さくらVPSにメールサーバを設定します。

【前提】
  • Value Domainで取得しているドメインを使うので、DNSのmx設定はValue Domainで行う。
  • メールサーバとして、さくらVPSPostfixをインストールする。
  • ここでの例としては、ドメインをabc.com、メールサーバを動かすホストをfoge.abc.comとする。

【Value Domainの設定】
Value DomainのDNS設定にて以下の設定を行う。
mx foge.abc.com. 10     ※ 最後のピリオドを付け忘れないこと
a foge

【さくらVPSの設定】
(1) 不要なサービスの停止
% setup
System Servicesを選択し、以下を除外
acpid, cpuspeed, ip6tables, iptables, irqbalance, iscsi, iscsid, sendmail
(2) Postfixのインストール
% yum install postfix
(3) /etc/postfix/main.cfを以下のように修正する。
myhostname = abc.com
mydomain = abc.com
myorigin = $mydomain
mynetworks = 127.0.0.1
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
home_mailbox = Maildir/
(4) mtaをpostfixに変更
% alternatives --config mta    postfixを選択する
(5) postfixの起動
%chkconfig postfix on
% service postfix start

設定するにあたり、こちらを参照しました