質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
Postfix

Postfixは、電子メールサーバソフトウェアで、 メールを配送するシステムMTAの一種です。

メール

メールは、コンピュータネットワークを利用し、 情報等を交換する手段のことです。

Q&A

解決済

2回答

21569閲覧

【postfix】メール送信を行いたいのですが、エラーが出て送れません。

Sfidante

総合スコア90

Postfix

Postfixは、電子メールサーバソフトウェアで、 メールを配送するシステムMTAの一種です。

メール

メールは、コンピュータネットワークを利用し、 情報等を交換する手段のことです。

0グッド

0クリップ

投稿2015/08/07 14:47

postfixを利用して、
メール送信をおこないたいのですが、
下記のエラーが出て
メール送信がうまくいきません。

なお、postfixはAWSのEC2内にインストールして利用しています。

メールの送信方法は以下のようにおこないました

sendmail "Toメールアドレス" From:"このサーバのメールアドレス" To:"Toメールアドレス" Subject:test test .

送信後の/var/log/maillogが下記になります。

Aug 7 14:00:33 ip-10-0-0-112 postfix/pickup[11507]: 86FB040E52: uid=0 from=<root> Aug 7 14:00:33 ip-10-0-0-112 postfix/cleanup[11682]: 86FB040E52: message-id=<20150807140033.86FB040E52@"hostname"> Aug 7 14:00:33 ip-10-0-0-112 postfix/qmgr[8232]: 86FB040E52: from=<root@"hostname">, size=282, nrcpt=1 (queue active) Aug 7 14:00:33 ip-10-0-0-112 postfix/smtpd[11685]: warning: No server certs available. TLS won't be enabled Aug 7 14:00:33 ip-10-0-0-112 postfix/smtpd[11685]: connect from "hostname"["IPアドレス"] Aug 7 14:00:33 ip-10-0-0-112 postfix/smtpd[11685]: warning: SASL: Connect to private/auth failed: No such file or directory Aug 7 14:00:33 ip-10-0-0-112 postfix/smtpd[11685]: fatal: no SASL authentication mechanisms Aug 7 14:00:34 ip-10-0-0-112 postfix/master[8229]: warning: process /usr/libexec/postfix/smtpd pid 11685 exit status 1 Aug 7 14:00:34 ip-10-0-0-112 postfix/master[8229]: warning: /usr/libexec/postfix/smtpd: bad command startup -- throttling Aug 7 14:00:34 ip-10-0-0-112 postfix/smtp[11684]: 86FB040E52: to=<"任意のメールアドレス">, relay="hostname"["IPアドレス"]:25, delay=29, delays=28/0/1/0, dsn=4.4.2, status=deferred (lost connection with "hostname"["IPアドレス"] while receiving the initial server greeting)

main.cfの設定が下記になります。

postconf -n alias_database = hash:/etc/aliases alias_maps = hash:/etc/aliases broken_sasl_auth_clients = yes command_directory = /usr/sbin config_directory = /etc/postfix daemon_directory = /usr/libexec/postfix data_directory = /var/lib/postfix debug_peer_level = 2 home_mailbox = Maildir/ html_directory = no inet_interfaces = all inet_protocols = all mail_owner = postfix mailbox_size_limit = 1073741824 mailq_path = /usr/bin/mailq.postfix manpage_directory = /usr/share/man message_size_limit = 10485760 mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain mydomain = "domain" myhostname = "hostname" mynetworks = 10.0.0.0/16 myorigin = $myhostname newaliases_path = /usr/bin/newaliases.postfix queue_directory = /var/spool/postfix readme_directory = /usr/share/doc/postfix-2.6.6/README_FILES relayhost = ["hostname"] sample_directory = /usr/share/doc/postfix-2.6.6/samples sendmail_path = /usr/sbin/sendmail.postfix setgid_group = postdrop smtpd_banner = $myhostname ESMTP unknown smtpd_recipient_restrictions = permit_mynetworks permit_sasl_authenticated reject_unauth_destination smtpd_sasl_auth_enable = yes smtpd_sasl_path = private/auth smtpd_sasl_type = dovecot smtpd_use_tls = yes unknown_local_recipient_reject_code = 550

現在行ったことは、
smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated,reject_unauth_destination
の確認と
smtpd_sasl_local_domain = $myhostname
の追加です

参考ページが下記になります。
http://kajuhome.com/patio_thread/1118.shtml
http://www.kumakake.com/%E6%9C%AA%E5%88%86%E9%A1%9E/315

何卒よろしくお願いいたします。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答2

0

ベストアンサー

まず、この Postfix から直接相手のメールサーバー(MX)に送るのであれば、relayhost を設定してはいけません。ループしてしまいます。

sendmail コマンドでメールを送信しようとしているので、接続元が localhost(127.0.0.1)になると思うのですが、mynetworks に含まれていません。mynetworks に 127.0.0.0/8 を追加しましょう。

mynetwork に含まれていないので、SMTP-Auth での認証を試みようとして、設定の不備により smtpd が異常終了しています。ソケット private/auth (/var/spool/postfix/private/auth でしょうか?)が無いとのこと。おそらく、dovecot auth で認証したいのだと思いますが、dovecot が起動していないか、dovecot の設定が不足しているのではないでしょうか。

投稿2015/08/07 16:44

TaichiYanagiya

総合スコア12141

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

Sfidante

2015/08/07 19:48

ご回答ありがとう御座います。 TaichiYanagiyaさんの仰られる通りにしたところ 送信がうまくいきました。 ありがとうございました。
guest

0

sh

1warning: SASL: Connect to private/auth failed: No such file or directory

なので、SASLの設定を見直しましょう。

投稿2015/08/07 16:44

退会済みユーザー

退会済みユーザー

総合スコア0

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問