LoginSignup
9
10

More than 5 years have passed since last update.

postfix(Maildir運用)のインストールと設定

Posted at

postfixのインストール(main.cf編集前まで)

shellでの操作
# sendmailの停止
sudo service sendmail stop
# postfixの停止
sudo yum install postfix
# OSのMTAをpostfixに変更
sudo alternatives --config mta # postfixの番号を選択してEnterを押下する
# sendmailの自動起動を抑止
sudo chkconfig sendmail off
# postfixの自動起動を設定
sudo chkconfig postfix on
# ユーザー作成時にMaildir形式のメールボックスが作成される設定
sudo mkdir -p /etc/skel/Maildir/{new,cur,tmp}
sudo chmod -R 700 /etc/skel/Maildir/
# ユーザーを作成(確認用のため、作成は任意)
sudo useradd postfixtest
sudo ls -al /home/postfixtest/Maildir # メールボックスの確認
sudo passwd postfixtest

main.cfの編集

shellでの操作
cd /etc/postfix
sudo cp main.cf main.cf.20141030
sudo vi main.cf

main.cfの編集内容

  1. myhostnameをアンコメントし、値にFQDNを指定
  2. mydomainをアンコメントし、値に自ドメインを指定
  3. myoriginをアンコメントし、値に $mydomain を指定
  4. mydestinationの値に $myhostname, localhost.$mydomain, localhost, $mydomain を指定
  5. home_mailboxをアンコメントし、値を Maildir/ と指定
  6. smtpd_bannerをアンコメントし、値を $myhostname ESMTP unknown と指定
  7. inet_interfacesの値に all を指定
  8. inet_protocolsの値に ipv4 を指定

編集内容のチェック

shellでの操作
sudo /etc/rc.d/init.d/postfix check # OKと出力されれば良い

postfixの起動

shellでの操作
sudo service postfix start
9
10
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
10