scavin
(scavin)
2026 年 9 月 6 日午前 4:30
1
こんにちは、
公式の discourse/mail-receiver:release Dockerイメージが見過ごされているか、かなり長期間再ビルドされていない可能性があります。
GitHubリポジトリは現在も積極的にメンテナンスされています:
通过在 GitHub 上创建帐户来为 discourse/mail-receiver 开发做出贡献。
しかし、公式のDockerイメージ:
discourse/mail-receiver:release
は、ほぼ2年前 にビルドされたもののように見えます。
これにより、現在のDiscourseバージョンとの互換性問題が発生しているようです。
私の場合、受信メールは正常にメールレシーバーに到達しますが、RCPT TO 段階で以下のようなエラーで拒否されます:
450 4.7.1 Recipient address rejected: Internal error, API request failed
古いDockerイメージは、まだ smtp_should_reject / 高速拒否メカニズムを使用しているようです。
しかし、現在のDiscourseソースには次のようなコメントが含まれています:
# this endpoint has been broken for years
# and was used only in the public mail-receiver's fast rejection code,
# which is removed in https://github.com/discourse/mail-receiver/pull/33
PR #33 はすでに mail-receiver からその高速拒否コードを削除していますが、これらの変更は現在公開されている discourse/mail-receiver:release イメージには反映されていないようです。
公式の mail-receiver ドキュメント/README では、まだユーザーに次のように使用することを指示しています:
discourse/mail-receiver:release
したがって、最近の変更後にDockerイメージの公開プロセスが単に漏れてしまったのではないかと考えます。
新しい discourse/mail-receiver:release イメージのビルドと公開が必要かどうか、ご確認いただけますでしょうか。
よろしくお願いいたします!
scavin
(scavin)
2026 年 9 月 6 日午前 5:04
2
更新: 現在の main ブランチをテストしました
現在の main ブランチをローカルでビルドし、別の問題が見つかりました。
Docker Hub の旧 release イメージでは、まだ旧来の fast-rejection コードが実行され、RCPT の段階で以下のエラーが発生します:
450 4.7.1 Recipient address rejected: Internal error, API request failed
しかし、現在の main ブランチでは、smtp_should_reject / fast-rejection の実装がすでに削除されています。main をビルドすると、Postfix は代わりに以下で失敗します:
warning: connect to private/policy: No such file or directory
451 4.3.5 Recipient address rejected: Server configuration problem
これは Dockerfile に残っている2つの参照に起因していることが特定できました:
check_policy_service unix:private/policy
ポリシーサービス自体は削除されていますが、smtpd_recipient_restrictions がまだそのソケットを参照しています。
smtpd_recipient_restrictions から unix:private/policy を削除し、イメージを再ビルドしたところ、受信 SMTP メールが正常に受け入れられるようになりました。
Global API Key に切り替えた後、Discourse への配信も成功しました:
dsn=2.0.0, status=sent (delivered via discourse service)
したがって、2つの別々の問題があるようです:
公開されている discourse/mail-receiver:release イメージは古く、まだ旧来の fast-rejection 実装が含まれています。
現在の main ブランチではその実装が削除されていますが、Dockerfile はまだ Postfix が unix:private/policy を使用するよう設定されています。
また、Granular API Key に関する別個の問題もある可能性があります: receive emails のスコープに限定されたキーでは /admin/email/handle_mail から HTTP 404 が返されましたが、Global API Key では HTTP 200 が返されました。
必要であれば、Dockerfile 内の古い private/policy 参照2つに対する PR を提出できます。
「いいね!」 2
Ethsim2
(Ethan )
2026 年 9 月 6 日午前 7:01
3
mail-receiver の別の変更で、公開されているリリースイメージが古いことを確認しました。
私はこの PR を作成し、8月11日にマージされました:
main ← Ethsim12:fix-email-encoded
merged 01:09PM - 11 Aug 26 UTC
## What does this change?
Updates mail-receiver to send incoming MIME messages … using the
`email_encoded` parameter expected by Discourse's `/admin/email/handle_mail`
endpoint.
The message is encoded with `Base64.strict_encode64` before being added to
the form data.
This removes use of the deprecated raw `email` parameter.
## Why?
Discourse currently logs a deprecation notice for every incoming email sent
by mail-receiver:
> the email parameter is deprecated. all POST requests to this route should
> be sent with a base64 strict encoded email_encoded parameter instead
A freshly rebuilt `discourse/mail-receiver:release` still reproduces the
warning because the current mail-receiver code continues to send `email`.
## Tests
Adds regression coverage which verifies that:
- the deprecated `email` parameter is not sent
- `email_encoded` is sent
- the encoded value represents the original MIME message
Tested locally with Ruby 3.2.11:
- `bundle exec rake test` — 16 examples, 0 failures
- `bundle exec rubocop` — no offenses
- `bundle exec stree check ...` — all files matched expected format
This is related to #13, which proposed the same API migration in 2023.
This PR refreshes that change against current `main` and adds regression
coverage.
これにより、メールレシーバーが以下のように変更されます:
post.set_form_data(email: @mail)
から、Discourse が期待する新しい email_encoded パラメータに:
PR がマージされた後、8月17日に mail-receiver を再ビルドしましたが、新しく再ビルドされたコンテナには依然として以下が含まれていました:
post.set_form_data(email: @mail)
マージされた PR に詳細を追加しました:
main ← Ethsim12:fix-email-encoded
Thanks again for merging this.
I rebuilt `mail-receiver` again today (17 August… ), but the published
`discourse/mail-receiver:release` image still appears to contain the old
implementation.
The rebuild reports the `release` image as up to date, and checking the
freshly rebuilt running container gives:
```text
# docker exec mail-receiver \
grep -n -E 'base64|set_form_data' \
/usr/local/lib/site_ruby/mail_receiver/discourse_mail_receiver.rb
40: post.set_form_data(email: @mail)
```
A newly received email therefore still produces the `email parameter is
deprecated` warning in Discourse.
Since #37 is merged into `main`, does the
`discourse/mail-receiver:release` Docker image need to be rebuilt/published
separately for this change to reach normal self-hosted installations?
8月22日に再度再ビルドし、./launcher rebuild mail-receiver は公開されているリリースイメージが最新であると報告し、ダイジェストは以下の通りでした:
sha256:2a0d45bb92a783c846a821e635413764eeadb3441ef6190085545a4bf054cb1e
私のインストールでは受信メールは引き続き機能していますが、公開イメージにマージされた #37 の変更が含まれていないため、受信される各メールに対して Discourse の以下のような警告が引き続きトリガーされます:
the email parameter is deprecated
したがって、これはあなたが最初に見つけた問題を独立して確認するものと思われます。mail-receiver リポジトリにマージされた変更が、公開されている discourse/mail-receiver:release イメージに反映されていないのです。
「いいね!」 1