Ubuntuの公式ガイドに従ってください。Postfixのインストールと設定、私が走るとき
telnet localhost 25
わかりました。
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.
得たログを見ると
$ sudo tail /var/log/mail.err
Dec 7 11:38:17 <host> postfix/smtpd[8477]: fatal: no SASL authentication mechanisms
上記の例は、仮想マシンで実行されているがクラウド上のサーバーからドメインにリモートで実行さtelnet
れていても、同じシナリオが発生します。 (私は何が起こっているのかを理解しやすくするために、仮想マシンでプロセスを複製してみました。)
以前の投稿と新しい投稿、ブログ、記事の両方を読んで考えることができるすべての設定を試しましたが、エラーは続きます。私は何が間違っているのか分かりません。私の設定:
/etc/postfix/main.cf
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname
smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)
biff = no
# appending .domain is the MUA's job.
append_dot_mydomain = no
# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h
readme_directory = no
# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 3.6 on
# fresh installs.
compatibility_level = 3.6
# TLS parameters
smtpd_tls_cert_file = /etc/ssl/certs/server.crt
smtpd_tls_key_file = /etc/ssl/private/server.key
smtpd_tls_security_level = may
smtp_tls_CApath=/etc/ssl/certs
smtp_tls_security_level = may
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
myhostname = <host>
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = <host>, <host>.local, <host>, localhost.localdomain, localhost
relayhost =
mynetworks = 127.0.0.0/8 [::1]/128 [::ffff:127.0.0.0]/104 [::1]/128 192.168.30.0/24
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
home_mailbox = Maildir/
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous,noplaintext
smtpd_sasl_tls_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_sasl_auth_enable = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination
smtp_tls_note_starttls_offer = yes
smtpd_tls_loglevel = 4
smtpd_tls_received_header = yes
/etc/dovecot/conf.d/10-master.conf
service auth {
unix_listener auth-userdb {
#mode = 0666
#user =
#group =
}
# Postfix smtp-auth
unix_listener /var/spool/postfix/private/auth {
mode = 0660
user = postfix
group = postfix
}
# Auth process is run as this user.
#user = $default_internal_user
}
公式ガイドに従って作成したVMのSSLファイルセキュリティ - 証明書。私のクラウドサーバーでLet's encrypt / Certbotファイルを使用しようとしています。私はそれらを次に追加します/etc/dovecot/conf.d/10-ssl.conf文書
ssl_cert = </etc/ssl/certs/server.crt
ssl_key = </etc/ssl/private/server.key
設定が変更されるたびにPostfixサービスとDovecotサービスを再起動しました。サービスの説明:
サフィックス
● postfix.service - Postfix Mail Transport Agent
Loaded: loaded (/lib/systemd/system/postfix.service; enabled; vendor preset: enabled)
Active: active (exited) since Thu 2023-12-07 12:26:07 UTC; 9min ago
Docs: man:postfix(1)
Process: 3362 ExecStart=/bin/true (code=exited, status=0/SUCCESS)
Main PID: 3362 (code=exited, status=0/SUCCESS)
CPU: 1ms
dic 07 12:26:07 <host> systemd[1]: Starting Postfix Mail Transport Agent...
dic 07 12:26:07 <host> systemd[1]: Finished Postfix Mail Transport Agent.
ピジョンロフト
● dovecot.service - Dovecot IMAP/POP3 email server
Loaded: loaded (/lib/systemd/system/dovecot.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2023-12-07 12:26:08 UTC; 12min ago
Docs: man:dovecot(1)
https://doc.dovecot.org/
Main PID: 3372 (dovecot)
Status: "v2.3.16 (7e2e900c1a) running"
Tasks: 5 (limit: 2220)
Memory: 3.1M
CPU: 44ms
CGroup: /system.slice/dovecot.service
├─3372 /usr/sbin/dovecot -F
├─3373 dovecot/anvil
├─3374 dovecot/log
├─3375 dovecot/config
└─3381 dovecot/stats
dic 07 12:26:08 <host> systemd[1]: Starting Dovecot IMAP/POP3 email server...
dic 07 12:26:08 <host> dovecot[3372]: master: Dovecot v2.3.16 (7e2e900c1a) starting up without any protocols (core dumps disabled)
dic 07 12:26:08 <host> systemd[1]: Started Dovecot IMAP/POP3 email server.
フォローするトラブルシューティングセクションを参照してください。多くの置換を試しましたが、何も機能せず、ログには作業可能な詳細はありません。
問題はすでに長すぎる、たくさん試してみたのでもう作成したくないので、コメントで質問してください。必要に応じて関連情報を追加するように編集します。おそらく私は非常に基本的なものを見逃しているようです。
ベストアンサー1
優れたサフィックスのデフォルト値を使用することをお勧めします。公式ガイドに従って、最小限(および説明を含む)構成を作成するのが最善です。上記のパラメータのデフォルト値は次のとおりです。
postconf -d | grep -E "smtpd_sasl.*security_options"
smtpd_sasl_security_options = noanonymous
smtpd_sasl_tls_security_options = $smtpd_sasl_security_options