各社VPSサーバの比較と設定方法をわかりやすく説明します。初期費用、月額料金、最低利用期間、無料トライアル・返金制度の有り無し、サーバ設置場所、メモリー、HDD、OSなどの比較ができます。

VPS設定のつぼ SPPDレンタルサーバ Mailサーバ(Postfix・Dovecot)

(1)SMTPサーバー Postfixインストール
qmailのインストールはこちら≫
[root@vps ~]# yum -y install postfix
(2)Postfix設定ファイル編集
[root@vps ~]# vi /etc/postfix/main.cf

70行目 コメント解除 使用するホスト名に変更
#myhostname = virtual.domain.tld
 ↓
myhostname = mail.vps-tora.com

77行目 コメント解除 使用するドメインに変更
#mydomain = domain.tld
 ↓
mydomain = vps-tora.com

93行目 コメント解除
#myorigin = $mydomain
 ↓
myorigin = $mydomain

110行目 localhostをallに変更
inet_interfaces = localhost
 ↓
inet_interfaces = all

410行目 コメント解除
#home_mailbox = Maildir/
 ↓
home_mailbox = Maildir/

560行目 コメント解除 $mail_nameをunknownに変更
#smtpd_banner = $myhostname ESMTP $mail_name
 ↓
smtpd_banner = $myhostname ESMTP unknown

最終行へ追記
smtpd_sasl_auth_enable = yes
smtpd_sasl_local_domain = $myhostname
smtpd_recipient_restrictions =
permit_mynetworks
permit_sasl_authenticated
reject_unauth_destination

(3)saslauthd起動
[root@vps ~]# /etc/rc.d/init.d/saslauthd start
Starting saslauthd: [ OK ]
(4)saslauthd自動起動設定
[root@vps ~]# chkconfig saslauthd on
(5)sendmail停止
[root@vps ~]# /etc/rc.d/init.d/sendmail stop
sm-client を停止中: [ OK ]
sendmail を停止中: [ OK ]
(6)sendmail自動起動解除
[root@vps ~]# chkconfig sendmail off
(7)メールサーバーをPostfixに切替え
[root@vps ~]# alternatives –config mta

2 プログラムがあり ‘mta’ を提供します。

Selection Command
———————————————–
*+ 1 /usr/sbin/sendmail.sendmail
2 /usr/sbin/sendmail.postfix

Enter を押して現在の選択 [+] を保持するか、選択番号を入力します: 2 ←2を入力

(8)Postfix起動
[root@vps ~]# /etc/rc.d/init.d/postfix start
postfix を起動中: [ OK ]
(9)Postfix自動起動設定
[root@vps ~]# chkconfig postfix on
(10)POP/IMAPサーバー Dovecotインストール
[root@vps ~]# yum -y install dovecot
(11)Dovecot設定ファイル編集
[root@vps ~]# vi /etc/dovecot.conf

20行目 コメント解除 pop3 pop3sを削除
#protocols = imap imaps pop3 pop3s
 ↓
protocols = imap imaps

211行目 コメント解除 maildir:~/Maildirを追加
#mail_location =
 ↓
mail_location = maildir:~/Maildir

(12)Dovecot起動
[root@vps ~]# /etc/rc.d/init.d/dovecot start
Dovecot Imap を起動中: [ OK ]
(13)Dovecot自動起動設定
[root@vps ~]# chkconfig dovecot on