ローカルメールサーバー(ubuntu 11.10)構築メモ その3

ローカルメールサーバー(ubuntu 11.10)構築メモ その2
でCGIが使えるようになったので、ここでローカルメールサーバー構築します
sudo apt-get install postfix
sudo apt-get install sasl2-bin
なぜか、postfix-tls はインストールできなかったので後回し
postfix をインストールするときに、ウィンドウがでるので、今回は
一番上の設定なし(もしくは No Configuration) を選択します
毎回 sudo を入れるのは面倒なので、
su –
で管理者権限で行動します
次に、設定ファイルをコピー
cp /usr/lib/postfix/main.cf /etc/postfix/main.cf
次に、ホスト名を
hostname コマンドを実行し調べます
hostname
だけで表示されます
以下は設定ファイルの変更です

sed -i "59s/^#//" /etc/postfix/main.cf
sed -i "76s/^#//" /etc/postfix/main.cf
sed -i "76s/virtual.domain.tld/mail.snowpool-virtual-machine/" /etc/postfix/main.cf
sed -i "83s/^#//" /etc/postfix/main.cf
sed -i "83s/domain.tld/snowpool-virtual-machine/" /etc/postfix/main.cf
sed -i "104s/^#//" /etc/postfix/main.cf
sed -i "118s/^#//" /etc/postfix/main.cf
sed -i "166s/^#//" /etc/postfix/main.cf
sed -i "209s/^#//" /etc/postfix/main.cf
sed -i "388s/^#//" /etc/postfix/main.cf
sed -i "399s/^#//" /etc/postfix/main.cf
sed -i "421s/^#//" /etc/postfix/main.cf
sed -i "526s/^#//" /etc/postfix/main.cf
sed -i "526a body_checks = regexp:/etc/postfix/body_checks" /etc/postfix/main.cf
sed -i "553s/^/#/" /etc/postfix/main.cf
sed -i "553a smtpd_banner = \$myhostname ESMTP" /etc/postfix/main.cf
sed -i "628s/\$/\ \/usr\/sbin\/postfix/" /etc/postfix/main.cf
sed -i "633s/\$/\ \/usr\/bin\/newaliases/" /etc/postfix/main.cf
sed -i "638s/\$/\ \/usr\/bin\/mailq/" /etc/postfix/main.cf
sed -i "644s/\$/\ postdrop/" /etc/postfix/main.cf
sed -i "648s/^/#/" /etc/postfix/main.cf
sed -i "652s/^/#/" /etc/postfix/main.cf
sed -i "657s/^/#/" /etc/postfix/main.cf
sed -i "661s/^/#/" /etc/postfix/main.cf

ここまででpostfix の設定が完了です
ちょっと省いていますので、簡易メールサーバーになっています

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です