くだらねえ質問はここに書き込め! Part 237
■ このスレッドは過去ログ倉庫に格納されています
まずは2ch-Linux-Beginnersを読みましょう。
いろいろとまとめられているので(・∀・)イイ!!
http://www12.atwiki.jp/linux2ch/
読んでも解決しなかったら、質問を書きこむ前にここを読もう。
http://www12.atwiki.jp/linux2ch/?About
質問に対して答えてもらったら、お礼よりも、結果報告。
過去ログ検索
Google検索
https://www.google.com/search?hl=ja&as_q=検索語句&as_sitesearch=2ch.net%2Ftest%2Fread.cgi%2Flinux%2Fhttps://www.google.com/search?hl=ja&as_q=検索語句&as_sitesearch=5ch.net%2Ftest%2Fread.cgi%2Flinux%2F
※前スレ
くだらねえ質問はここに書き込め! Part 236
http://mao.5ch.net/test/read.cgi/linux/1556462911/ >>63
Postfixに関しては、以下のサイトの2つのページの部分しか
デフォルトからいじってないのですが、ここにその項目あります?
Postfix : インストール/設定
https://www.server-world.info/query?os=Ubuntu_18.04&p=mail&f=1
SSL/TLS の設定
https://www.server-world.info/query?os=Ubuntu_18.04&p=mail&f=6
main.cfの
relayhost = [mail2.example.com]
relayhost = [mail.example.com]
のことですか?
http://www.maruko2.com/mw/Postfix_%E3%81%A7%E3%83%A1%E3%83%BC%E3%83%AB%E3%83%AA%E3%83%AC%E3%83%BC%E3%81%AE%E8%A8%AD%E5%AE%9A_(SMTP_%E3%82%AF%E3%83%A9%E3%82%A4%E3%82%A2%E3%83%B3%E3%83%88_%2B_SMTP_Auth) >>57
OCNのSMTPサーバに接続して自分のOCNアカウント宛に送るということ? >>59との関係がよく分からない。
普通は
@固定IPならOP25Bがないことも普通で、その場合送信メールはリレーなしで直接宛先サーバの25に送れる。SPF等を適切に設定すれば、自分のドメインのアカウントを自由に作って差し出し人アドレスにできる。
A固定IPでなければOP25Bのせいで直接は送れないから、プロバのサーバの587につなぎ、認証してからリレーしてもらう。この時差し出し人アドレスはプロバのメールアドレスに限られるのが普通。
Bmydnsとか一部のddnsサービスでは、リレーサーバも提供されているから、Aと同じ方法で独自のアドレスを差し出し人にできる。
どうもAをやろうとして、プロバの認証をしていないように見える >>65
Connection Refuseって書いてあるwww >>64
上のAやBの場合、
relayhostに加えて、その最後のページの
「リレー先サーバーがSMTP認証(SMTP-AUTH)を要求する場合の設定」
が普通は必要 >>64
多分それかな?
ISPのSMTPadressを入れる >>65
違うよ
自分のサーバー(192.168.0.2)で作ったメアドから
自分の入ってるプロバイダーのメールアドレス宛にメール送ろうとしてるんだよ
直接自分のプロバイダーに接続しないよ
自分のサーバーのSMTP使って送ろうとしてる。 >>65
(2)であってるよ
ただし、ログ見るとプロバイダーの25番ポートに接続しにいってる。
to=<myプロバから貰ったmailaddress@ocn.ne.jp
>, relay=****.ocn.ad.jp[***.***.63.72]:25,
delay=0.4, delays=0.23/0/0.17/0,dsn=5.7.1,
status=bounced (host ****.ocn.ad.jp[***.***.63.72] refused to talk to me:
*** *.*.* <自分のIPアドレス>: Client host rejected: Access denied)
>>67-68
マジですか?
でも、ISPのアドレスって/etc/log/mail.log
見ると複数ありますよ
手動で全部登録ですかあ・・・(ため息 どのみちOP25Bで自分のサーバー名のメアドは弾かれるだろうなあ
てか、自分のサーバーのメアドでプロバのメアド宛てに送ったときって
自分のサーバーのメアド → 自分のサーバーのSMTP → プロバイダーのPOP → プロバ受信
かと思ってたわ
思いっきり、プロバのSMTP通すんだな
直接プロバのPOPに送ってくれればいいのに
しかし、関係ないが最近の2chは
NGワードかなんかで長文書き込めないなあ >>71
いや、relayhostに書くのは25じゃなくて587が開いてる方1つ。プロバ契約した時の送信メールサーバってやつ。つまり普通にメーラに登録するやつ。 >>72
おお、そうですか
これは分かりやすい
ということは、relayhostにサーバー登録とSMTP認証の設定だけですね
後で、試してみます >>71
>>どのみちOP25Bで自分のサーバー名のメアドは弾かれるだろうなあ
OP25Bは名前の通りポート25を閉じるやつで、リレーサーバ経由で送る時は587を使うから全く関係ない
独自のドメインのアドレスを弾くかどうかは単にリレーサーバのポリシーでOP25Bとは別物
>>てか、自分のサーバーのメアドでプロバのメアド宛てに送ったときって
自分のサーバーのメアド → 自分のサーバーのSMTP → プロバイダーのPOP → プロバ受信
かと思ってたわ
メールを最終的なメールボックスがあるサーバまで(必要があれば転送しながら)届けるのがSMTPで、自分のメールボックスの中身を見たりいじるのがPOPとかIMAP ソースからビルドするタイプのパッケーマネージャーってPortageとArchのABS以外に何がありますか?
Linuxで動くものならなんでもいいです /etc/postfix/main.cfのSMTP認証、TLS暗号化設定しました。
これってもはや自分のサーバーから出したメール弾かれてるよね?
リレーしてくれないよ
connect to smtp.ocn.ne.jp[153.149.232.193]:587: Connection timed out
EEE33336F: to=<username@ocn.ne.jp>,
relay=none, delay=3300, delays=3240/0.02/60/0, dsn=4.4.1,
status=deferred
(connect to smtp.ocn.ne.jp[153.149.231.65]:587: Connection timed out) /etc/postfix/main.cfの設定はこうです。
# SMTP-AUTH認証
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
smtpd_recipient_restrictions = permit_mynetworks, permit_auth_destination, permit_sasl_authenticated, reject
relayhost = [smtp.ocn.ne.jp]:587
smtp_sasl_password_maps = hash:/etc/postfix/relay_password
# TLS暗号化
#smtpd_use_tls = yes
smtp_tls_security_level = may
smtp_tls_mandatory_protocols = !SSLv2, !SSLv3
smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3
smtpd_tls_cert_file = /etc/ssl/private/aaa.crt
smtpd_tls_key_file = /etc/ssl/private/aaa.key
#smtpd_tls_CAfile = /etc/ssl/private/bbb.pem
smtpd_tls_session_cache_database = btree:/etc/postfix/smtpd_scache ここのサイト参照。
Postfix : インストール/設定
https://www.server-world.info/query?os=Ubuntu_18.04&p=mail&f=1
SSL/TLS の設定
https://www.server-world.info/query?os=Ubuntu_18.04&p=mail&f=6
Postfix でメールリレーの設定 (SMTP クライアント + SMTP Auth)
http://www.maruko2.com/mw/Postfix_%E3%81%A7%E3%83%A1%E3%83%BC%E3%83%AB%E3%83
%AA%E3%83%AC%E3%83%BC%E3%81%AE%E8%A8%AD%E5
%AE%9A_(SMTP_%E3%82%AF%E3%83%A9%E3%82%A4%E3%82%A2%E3%83%B3%E3%83%88_%2B_SMTP_Auth
>>71
分かりやすい説明ありがとうございます。
SMTPとPOPってそういうことだったのですね >>76
どうもsmtp.ocn.ne.jpはsmtpsを使っているっぽいね
だからポート465になる
・ポート25/587はつないですぐは平文、STARTTLSで(必要に応じて)暗号文に移行
・ポート465は初めからいきなり暗号文 >>79
ありがとうございます。
relayhost = [smtp.ocn.ne.jp]:465
にしてもだめでした
もうお手上げですわ・・・ >>80
ここあたりはどう
ttp://www.uetyi.com/server-const/entry-456.html >>80
ログをもう少し晒さないと分からないが、
smtp_tls_security_level=encrypt
smtp_tls_wrappermode=yes
かな >>77
「smtpd_〜」で始まるのは自分がクライアントを「認証する側」の場合の設定
リレーしてもらうには自分がクライアントとして「認証される側」の設定として
>>81 が紹介してるサイトに書いてあるような「smtp_〜」で始まる
smtp_sasl_auth_enable = yes
などの一連の設定が必要だよ /etc/postfix/main.cf
# SMTPAuth
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
smtpd_sasl_local_domain = $myhostname
smtpd_recipient_restrictions = permit_mynetworks, permit_auth_destination, permit_sasl_authenticated, reject
relayhost = [smtp.ocn.ne.jp]:587
smtp_sasl_password_maps = hash:/etc/postfix/relay_password
# TLS
smtpd_use_tls = yes
smtp_tls_mandatory_protocols = !SSLv2, !SSLv3
smtpd_tls_mandatory_protocols = !SSLv2, !SSLv3
smtpd_tls_cert_file = /etc/ssl/private/aaa.crt
smtpd_tls_key_file = /etc/ssl/private/aaa.key
#smtpd_tls_CAfile = /etc/ssl/private/bbb.pem
smtpd_tls_session_cache_database = btree:/etc/postfix/smtpd_scache
smtp_tls_security_level=encrypt
smtp_tls_wrappermode=yes 上記でログはこうなりました。
Jul 20 14:45:54 ubuntu postfix/master[15834]: daemon started -- version 3.3.0, configuration /etc/postfix
Jul 20 14:46:33 ubuntu postfix/tlsmgr[15968]: warning: request to update table btree:/etc/postfix/smtpd_scache in non-postfix directory /etc/postfix
Jul 20 14:46:33 ubuntu postfix/tlsmgr[15968]: warning: redirecting the request to postfix-owned data_directory /var/lib/postfix
Jul 20 14:46:33 ubuntu postfix/smtps/smtpd[15967]: connect from ubuntu[192.168.0.3]
Jul 20 14:46:42 ubuntu postfix/smtps/smtpd[15967]: 7698E2162573: client=ubuntu[192.168.0.3], sasl_method=PLAIN, sasl_username=userhoge
Jul 20 14:46:42 ubuntu postfix/cleanup[16003]: 7698E2162573: message-id=<1111-1111-1111-1111@ubuntu>
Jul 20 14:46:42 ubuntu postfix/qmgr[15836]: 7698E2162573: from=<userhoge@ubuntu>, size=587, nrcpt=1 (queue active)
Jul 20 14:46:42 ubuntu postfix/smtps/smtpd[15967]: disconnect from ubuntu[192.168.0.3] ehlo=1 auth=1 mail=1 rcpt=1 data=1 quit=1 commands=6
Jul 20 14:47:12 ubuntu postfix/smtp[16004]: connect to smtp.ocn.ne.jp[153.149.231.65]:587: Connection timed out
Jul 20 14:47:42 ubuntu postfix/smtp[16004]: connect to smtp.ocn.ne.jp[153.149.232.193]:587: Connection timed out
Jul 20 14:47:42 ubuntu postfix/smtp[16004]: 7698E2162573: to=<ocnuser@***.ocn.ne.jp>,
relay=none, delay=60, delays=0.06/0.02/60/0, dsn=4.4.1, status=deferred (connect to smtp.ocn.ne.jp[153.149.232.193]:587: Connection timed out) /etc/postfix/main.cfにこれを追加した場合。
default_transport = smtp
Jul 20 14:55:09 ubuntu postfix/smtp[17781]: connect to smtp.ocn.ne.jp[153.149.232.193]:587: Connection timed out
Jul 20 14:55:12 ubuntu postfix/smtps/smtpd[17891]: connect from ubuntu[192.168.0.3]
Jul 20 14:55:12 ubuntu postfix/smtps/smtpd[17891]: 43BAD2162577: client=ubuntu[192.168.0.3], sasl_method=PLAIN, sasl_username=userhoge
Jul 20 14:55:12 ubuntu postfix/cleanup[17895]: 43BAD2162577: message-id=<1111-1111-1111-1111@ubuntu>
Jul 20 14:55:12 ubuntu postfix/qmgr[17778]: 43BAD2162577: from=<userhoge@ubuntu>, size=589, nrcpt=1 (queue active)
Jul 20 14:55:12 ubuntu postfix/smtps/smtpd[17891]: disconnect from ubuntu[192.168.0.3] ehlo=1 auth=1 mail=1 rcpt=1 data=1 quit=1 commands=6 >>85
smtp.ocn.ne.jp[153.149.232.193]:587
587じゃなくて465 >>87
465にしてみました。
Sender address rejected: need fully-qualified address (in reply to RCPT TO command))
これ独自のメール禁止ってことですか? Jul 20 23:56:40 ubuntu postfix/postfix-script[23552]: starting the Postfix mail system
Jul 20 23:56:40 ubuntu postfix/master[23554]: daemon started -- version 3.3.0, configuration /etc/postfix
Jul 20 23:57:01 ubuntu postfix/tlsmgr[23626]: warning: request to update table btree:/etc/postfix/smtpd_scache in non-postfix directory /etc/postfix
Jul 20 23:57:01 ubuntu postfix/tlsmgr[23626]: warning: redirecting the request to postfix-owned data_directory /var/lib/postfix
Jul 20 23:57:01 ubuntu postfix/smtps/smtpd[23625]: connect from ubuntu[192.168.0.3]
Jul 20 23:57:01 ubuntu postfix/smtps/smtpd[23625]: 41C772160BFD: client=ubuntu[192.168.0.3], sasl_method=PLAIN, sasl_username=userhoge
Jul 20 23:57:01 ubuntu postfix/cleanup[23631]: 41C772160BFD: message-id=<111-111-111-111-111@ubuntu>
Jul 20 23:57:01 ubuntu postfix/qmgr[23556]: 41C772160BFD: from=<userhoge@ubuntu>, size=577, nrcpt=1 (queue active)
Jul 20 23:57:01 ubuntu postfix/smtps/smtpd[23625]: disconnect from ubuntu[192.168.0.3] ehlo=1 auth=1 mail=1 rcpt=1 data=1 quit=1 commands=6
Jul 20 23:57:01 ubuntu postfix/smtp[23632]: 41C772160BFD: to=<ocnuser@***.ocn.ne.jp>,
relay=smtp.ocn.ne.jp[153.149.231.65]:465, delay=0.26, delays=0.07/0.01/0.06/0.11, dsn=5.5.2,
status=bounced (host smtp.ocn.ne.jp[153.149.231.65] said: 504 5.5.2 <userhoge@ubuntu>:
Sender address rejected: need fully-qualified address (in reply to RCPT TO command)) Jul 20 23:57:01 ubuntu postfix/cleanup[23631]: 84E0D2160C2F: message-id=<20190720145701.84E0D2160C2F@ubuntu>
Jul 20 23:57:01 ubuntu postfix/bounce[23633]: 41C772160BFD: sender non-delivery notification: 84E0D2160C2F
Jul 20 23:57:01 ubuntu postfix/qmgr[23556]: 84E0D2160C2F: from=<>, size=2579, nrcpt=1 (queue active)
Jul 20 23:57:01 ubuntu postfix/qmgr[23556]: 41C772160BFD: removed
Jul 20 23:57:01 ubuntu postfix/local[23634]: 84E0D2160C2F: to=<userhoge@ubuntu>,
relay=local, delay=0.14, delays=0.06/0.01/0/0.06, dsn=2.0.0, status=sent (delivered to maildir)
Jul 20 23:57:01 ubuntu postfix/qmgr[23556]: 84E0D2160C2F: removed うちのPCのドメインですか?
取ってないです。
ISPから貰ったIPアドレスだけです。
ローカルでUbuntuって名前つけてます。 userhoge@ubuntu
ってなってて.comとか.orgとかはついてないです。
もしかして>>89のアドレスってメアドの方じゃなくって
こっちの方ですか? ちゃんと勉強してからの方がよくね?
Postfixだから大丈夫だとは思うけど、
周りに迷惑かける奴のような気がする。 ■ このスレッドは過去ログ倉庫に格納されています