MAKIZOU.COM

WEB系SEのホームページ作成&サーバ構築運用メモ

postfixインストール&設定 - Linux

Postfix(ポスト・フィックス)は、Sendmailとの操作上の互換性を確保しつつ、管理・設定が容易で、高速・安全であることを指向して開発された、メール転送エージェント(MTA)です。
NetBSD、Mac OS Xなどで標準のMTAとして採用されています。

■postfixインストール
# yum -y install postfix

■使用MTA選択
# alternatives --config mta

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

選択 コマンド
———————————————–
* 1 /usr/sbin/sendmail.sendmail
+ 2 /usr/sbin/sendmail.postfix

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

画面に従って選択します。
Postfixを使用するので、「2」 を入力して[enter]キーで確定。

■設定ファイル
#vi /etc/postfix/main.cf

以下の太字部分が設定箇所

このホストのホスト名を設定
※ここではexample.comというドメイン名で使用します

# INTERNET HOST AND DOMAIN NAMES
#
# The myhostname parameter specifies the internet hostname of this
# mail system. The default is to use the fully-qualified domain name
# from gethostname(). $myhostname is used as a default value for many
# other configuration parameters.
#
#myhostname = host.domain.tld
#myhostname = virtual.domain.tld
myhostname = example.com

このホストのホスト名を設定
※ここではexample.comというドメイン名で使用します

# The mydomain parameter specifies the local internet domain name.
# The default is to use $myhostname minus the first component.
# $mydomain is used as a default value for many other configuration
# parameters.
#
#mydomain = domain.tld
mydomain = example.com

利用するインタフェースを設定
インターネット経由でメールの送受信が出来るように

# The inet_interfaces parameter specifies the network …
# addresses that this mail system receives mail on. …
# the software claims all active interfaces on the …
# parameter also controls delivery of mail to user@[ip.address].
#
# See also the proxy_interfaces parameter, for network …
# are forwarded to us via a proxy or network address translator.
#
# Note: you need to stop/start Postfix when this parameter …
#
inet_interfaces = all
#inet_interfaces = $myhostname
#inet_interfaces = $myhostname, localhost
#inet_interfaces = localhost

スプールをMaildir形式にする指定

# “Maildir/” for qmail-style delivery (the / is required).
#
#home_mailbox = Mailbox
home_mailbox = Maildir/

メール送信用サーバとして使用できるようにするため、SMTP認証
ファイルの末尾に以下の3行を追加

smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_sasl_authenticated, reject_unauth_destination

■CRAM-MD5方式でSMTP認証の認証設定
※ここではホスト名「example.com」アカウント名「test」で使用します

パスワードを設定
# saslpasswd2 -u example.com test

Password:[パスワード]
Again (for verification):[パスワード]

■起動
# /etc/init.d/saslauthd start

saslauthd を起動中: [ OK ]

# /etc/init.d/postfix start

Starting postfix: [ OK ]



  • カテゴリ:Web開発
  • 公開日:
  • 1つ星2つ星3つ星4つ星5つ星
    Loading ... Loading ...
    ↑ 記事評価をお願いします。

コメント&トラックバック

トラックバック用URL

コメント




使用できるXHTMLタグ <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>