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

VPS設定のつぼ 使えるねっと Mailサーバ(Postfix・Dovecot)

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

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

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

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

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

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

569行目 コメント解除 $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
Shutting down sm-client: [ OK ]
Shutting down sendmail: [ OK ]
(6)sendmail自動起動解除
[root@vps ~]# chkconfig sendmail off
(7)メールサーバーをPostfixに切替え
[root@vps ~]# alternatives –config mta

There are 2 programs which provide ‘mta’.

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

Enter to keep the current selection[+], or type selection number: 2 ←2を入力

(8)Postfix再起動
[root@vps ~]# /etc/rc.d/init.d/postfix restart
Shutting down postfix: [ OK ]
Starting postfix: [ OK ]
(9)POP/IMAPサーバー Dovecotインストール
[root@vps ~]# yum -y install dovecot
(10)Dovecot設定ファイル編集
10-mail.confファイルの修正

[root@vps ~]# vi /etc/dovecot/conf.d/10-mail.conf

30行目 コメント解除して追加
#mail_location =
 ↓
mail_location = maildir:~/Maildir

10-auth.confファイルの修正

[root@vps ~]# vi /etc/dovecot/conf.d/10-auth.conf

9行目 コメント解除 yesをnoに
#disable_plaintext_auth = yes
 ↓
#disable_plaintext_auth = no

97行目 loginを追加
auth_mechanisms = plain
 ↓
auth_mechanisms = plain login

10-master.confファイルの修正

[root@vps ~]# vi /etc/dovecot/conf.d/10-master.conf

88~90行目 コメント解除して追加
#unix_listener /var/spool/postfix/private/auth {
# mode = 0666
#}
 ↓

unix_listener /var/spool/postfix/private/auth {
mode = 0666
user = postfix←追加
group = postfix←追加
}

(11)Dovecot起動
[root@vps ~]# /etc/rc.d/init.d/dovecot start
Starting Dovecot Imap: [ OK ]
(9)Dovecot自動起動設定
[root@vps ~]# chkconfig dovecot on
^T[o[Ȃg˂