メールサーバー · 1 min read · Oct 05, 2025

フルメールサーバーソリューション w/ バーチャルドメインとユーザー (Debian Etch, Postfix, Mysql, Dovecot, DSpam, ClamAV, Postgrey, RBL) - ページ 11

B. セキュア Postfix+TLS

まず最初に、secure-mail.example.com に postfix をインストールする必要があります。この特定のインストールはクォータサポートを必要としません(ローカル配信を処理しないため)、しかし、物事をシンプルに保つために、上記と同じ方法でインストールします:

# dpkg -i postfix_2.3.8-2_i386.deb  
# dpkg -i postfix-mysql_2.3.8-2_i386.deb

自動設定がインストール中に postfix に関する質問をする場合は、「No Configuration」を選択してください。

dpkg は Postfix のすべての設定ファイルを /etc/postfix にインストールしますので、そこに移動し、main.cf ファイルを作成します:

# cd /etc/postfix  
# touch main.cf

main.cf ファイルは、2 つの異なる方法で編集できます。お気に入りのテキストエディタを使用するか、組み込みの postfix ツール postconf を使用できます。私たちはすでに IV.A のサブセクションでバージョンを確認するために postconf を一度使用しました。

postconf ツールの本当の利点は、いくつかの組み込みエラーチェックがあり、キャリッジリターン、改行、奇妙な引用符などによる「奇妙さ」の可能性を排除することです。このガイドではそれを使用しますが、実際には必須ではありません。

基本情報を入力することから始めましょう:

# postconf -e 'myhostname = secure-mail.example.com'  
# postconf -e 'smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)'  
# postconf -e 'biff = no'  
# postconf -e 'append_dot_mydomain = no'  
# postconf -e 'myorigin = example.com'  
# postconf -e 'inet_interfaces = all'  
# postconf -e 'local_recipient_maps ='  
# postconf -e 'local_transport = error:local mail delivery is disabled'  
# postconf -e 'smtpd_recipient_restrictions = permit_sasl_authenticated, reject'

今回はローカル配信を無効にしたことに気付くでしょう。これは基本的に単なるアウトバウンドリレーサーバーなので、メールを「配信」しようとはせず、単に転送するだけです。また、SMTP サーバーを SASL 認証されたセッションのみを許可し、他のセッションは拒否するように設定しました。

次に、SASL(SMTP 認証)の情報を入力します。これは接続を暗号化するものではなく、ユーザーにログインを要求するだけです:

# postconf -e 'smtpd_sasl_auth_enable = yes'  
# postconf -e 'smtpd_sasl_security_options = noanonymous'  
# postconf -e 'broken_sasl_auth_clients = yes'  
# postconf -e 'smtpd_sasl_type = dovecot'  
# postconf -e 'smtpd_sasl_path = private/auth'

これで、あなたの postfix インストールはすべての認証ニーズのために dovecot に問い合わせますが、まだ暗号化されていません。それを変更しましょう…

# postconf -e 'smtpd_tls_cert_file = /etc/ssl/example.com/mailserver/mail-cert.pem'  
# postconf -e 'smtpd_tls_key_file = /etc/ssl/example.com/mailserver/mail-key.pem'  
# postconf -e 'smtpd_tls_session_cache_database = btree:/var/spool/postfix/smtpd_tls_session_cache'  
# postconf -e 'smtpd_tls_security_level = encrypt'  
# postconf -e 'smptd_tls_received_header = no'  
# postconf -e 'smtpd_tls_loglevel = 0'  
# postconf -e 'tls_random_source = dev:/dev/urandom'

postfix をリロードしてください…

# postfix reload

そして、Dovecot を起動しましょう…

Share: X/Twitter LinkedIn

新しい投稿を受信箱で受け取る

スパムはありません。いつでも購読を解除できます。