前提・実現したいこと
CentOs7にてwebサーバーを構築しており、httpフォームから受けつけた内容から入力アドレスへメールを送信する仕組みを作成しているのですが、外部からの送信は受け付けずローカルからのメール送信のみを許容する形にしたく、smtpポートは閉じているのですが、maillogを確認したところ、中国系のスパムメールの送信痕跡が見つかりました。
慌てて、main.cfに
smtpd_recipient_restrictions = permit_mynetworks,reject_unauth_destination
を追記したところ、メール自体は、status=deferred となったことが確認できたのですが、なぜこのような踏み台になってしまったのかがわかりません。
理由がわからないので根本的な対策が受けられているのか自信がもてません。
smtpポートを閉じていても、踏み台になることはあり得るのでしょうか?
※指摘を受けて追記致します。
smtpポートを閉じている、というのは
25番ポートはfirewalldにて開放しておらず、外部からコネクトされないよう設定している、という意味です。
参考までに、開放しているポートは
http
https
ssh
ftp
dhcpv6-client
です。
発生している問題・エラーメッセージ
設定を追記する前の送信痕跡は以下です
Aug 28 19:04:16 tk2-219-19015 postfix/smtp[23048]: DC910C6DD0F: to=1445951342@qq.com, relay=mx3.qq.com[103.7.30.40]:25, delay=1.7, delays=0.01/0/0.24/1.4, dsn=2.0.0, status=sent (250 Ok: queued as )
※追記
上記の送信痕跡の関連ログと思われるものを以下に記します
(一部伏せ字にしていますが、XXXX@XXXXXX.xxxの箇所はアプリにて設定している送信アドレスです。
Aug 28 19:04:14 xxxxxxxxxxxxx postfix/pickup[23184]: E4A39C6D942: uid=48 from=<1445951342@qq.com> Aug 28 19:04:14 xxxxxxxxxxxxx postfix/cleanup[23044]: E4A39C6D942: message-id=<5b851e1edcff0@qq.com> Aug 28 19:04:14 xxxxxxxxxxxxx postfix/qmgr[1305]: E4A39C6D942: from=<1445951342@qq.com>, size=1358, nrcpt=1 (queue active) Aug 28 19:04:15 xxxxxxxxxxxxx postfix/smtp[23270]: E4A39C6D942: to=<XXXX@XXXXXX.xxx>, relay=aspmx.l.google.com[74.125.204.26]:25, delay=0.89, delays=0/0.01/0.53/0.34, dsn=5.7.1, status=bounced (host aspmx.l.google.com[74.125.204.26] said: 550-5.7.1 This message does not have authentication information or fails to pass 550-5.7.1 authentication checks. To best protect our users from spam, the 550-5.7.1 message has been blocked. Please visit 550-5.7.1 https://support.google.com/mail/answer/81126#authentication for more 550 5.7.1 information. g2-v6si693662pgg.83 - gsmtp (in reply to end of DATA command)) Aug 28 19:04:15 xxxxxxxxxxxxx postfix/cleanup[23044]: C9ADAC6DD10: message-id=<20180828100415.C9ADAC6DD10@xxxxxxxxxx.vs.sakura.ne.jp> Aug 28 19:04:15 xxxxxxxxxxxxx postfix/qmgr[1305]: C9ADAC6DD10: from=<>, size=3998, nrcpt=1 (queue active) Aug 28 19:04:15 xxxxxxxxxxxxx postfix/bounce[23054]: E4A39C6D942: sender non-delivery notification: C9ADAC6DD10 Aug 28 19:04:15 xxxxxxxxxxxxx postfix/qmgr[1305]: E4A39C6D942: removed Aug 28 19:04:16 xxxxxxxxxxxxx postfix/smtp[23083]: C9ADAC6DD10: to=<1445951342@qq.com>, relay=mx3.qq.com[103.7.30.40]:25, delay=0.5, delays=0/0/0.18/0.31, dsn=5.0.0, status=bounced (host mx3.qq.com[103.7.30.40] said: 550 Mail content denied [MFWduTTi91Eb1HPFJ+UWKg4pos6tjc5tIgYswoNgJx7ruPSgT3qvPMs= IP: 160.16.86.19]. http://service.mail.qq.com/cgi-bin/help?subtype=1&&id=20022&&no=1000726 (in reply to end of DATA command)) Aug 28 19:04:16 xxxxxxxxxxxxx postfix/qmgr[1305]: C9ADAC6DD10: removed
試したこと
smtpd_recipient_restrictions = permit_mynetworks,reject_unauth_destination
を追記したところ、
Aug 28 22:14:07 tk2-219-19015 postfix/error[26011]: F0593CF51F2: to=1973145288@qq.com, relay=none, delay=597, delays=596/0.46/0/0, dsn=4.4.2, status=deferred (delivery temporarily suspended: lost connection with mx2.qq.com[184.105.206.31] while performing the HELO handshake)
というようなメッセージが出るようになったので、とりあえず防げているのか・・・と思っているのですが、自信がありません。
回答1件
あなたの回答
tips
プレビュー