Postfix smtp認証に失敗しました

Postfix smtp認証に失敗しました

現在、既存のサーバーと同じタスクを実行するために新しいサーバーを更新しています(新しいサーバーが稼働しています)。息をのむ Debian、既存のサーバーが稼働しています。Debian スクイズ)。

私が経験している問題は、次のコードを使用して船を介して電子メールを送信することです。

$smtp = Mail::factory('smtp', array ('host'     => 'localhost',
                                     'port'     => '25',
                                     'auth'     => true,
                                     'username' => 'linuxUser',
                                     'password' => 'linuxPassword'));

$mail = $smtp->send($to, $headers, $text);

端末からメールを送信できます。

$mail [email protected] 

ただし、Pearを介して電子メールを送信するためにPHPスクリプトを実行しようとすると、mail.logにエラーが発生します。

メールログエラー

postfix/smtpd[7835]: warning: SASL authentication failure: unable to canonify user 
and get auxprops
postfix/smtpd[7835]: warning: localhost[::1] SASL DIGEST-MD5 authentication failed: 
authentication failure

私が変更したいくつかの設定ファイルについて簡単に説明します。

/etc/postfix/main.cf

# SMTP Authentication
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_auth_enable = yes
broken_sasl_auth_clients = yes
smtp_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks,
check_relay_domains, reject_unauth_destination

...     

smtpd_banner = mail.$mydomain ESMTP $mail_name  
mydomain = domain.com                           
myorigin = $mydomain                    
myhostname = mail.domain.com    
inet_interfaces = all

/etc/default/saslauthd

START=yes
MECHANISMS="shadow"
OPTIONS="-c -m /var/spool/postfix/var/run/saslauthd" 

/etc/postfix/sasl/smtpd.conf

pwcheck_method: saslauthd

最初はSASLユーザー名とパスワードが正しく設定されていないと思いました。ほとんどのオンラインチュートリアルでは、ユーザー名とパスワードが別々のデータベースファイルに保存されていることを示しています。しかし、私の場合、ユーザー名とパスワードはLinuxユーザー名/パスワードに割り当てられました。

なぜこれがうまくいかないのかわかりません。 postfix/SMTPのバグですか、それともpear/phpのバグですか?

ベストアンサー1

次の設定ファイルを変更しました。

/etc/postfix/sasl/smtpd.conf

pwcheck_method: saslauthd
mech_list: PLAIN LOGIN

これで認証が良くなります。

おすすめ記事