2013年1月26日土曜日

[番外編] メールサーバ構築

■postfixによるSMTPサーバ(CentOS)
(1)インストール
   yum install postfix

(2)動作設定
    /etc/postfix/main.cf

設定項目 内容
ホスト名 myhostname = [自分のホスト名]
ドメイン名設定 mydomain = [自分のドメイン名]
メール送信先 myorigin = $myhostname
メール受信設定 inet_interfaces = all
メールの最終目的地 mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
リレー許可ドメイン relay_domains = $mydestination
メール保存先 home_mailbox = Maildir/

(3)ポート設定
   25番ポート空ける

(4)alias設定
 postmaster, webmaster等の特別アカウントへのメールは通常rootに転送される
 これを本来のwebmasterユーザーで受信したい場合の設定

  /etc/aliases の以下の記述をコメントアウト
     webmaster: root

  newaliases コマンドで反映

(5)MTA(Message Transfer Agent)確認&切り替え
 複数のメール配信ソフトがインストールされている場合に行う。
  確認: alternatives --display mta
  変更: alternatives --config mta

(6)起動
   /etc/init.d/postfix start

■dovecotによるPOP3、IMAPサーバ構築
(1)インストール
   yum install dovecot

(2)動作設定
    /etc/dovecot/conf.d/10-main.cf
    /etc/dovecot/conf.d/auth-system.cf

(3)ポート設定
   110番ポート空ける

(4)起動
   /etc/init.d/dovecot start

0 件のコメント:

コメントを投稿