# Discourse/mail-receiver:release の Docker イメージが古いようです

**URL:** https://meta.discourse.org/t/discourse-mail-receiver-release-docker-image-appears-to-be-outdated/411734
**Category:** Bug
**Tags:** mail-receiver
**Created:** [2026 年 9 月 6 日午前 4:30 UTC](https://meta.discourse.org/t/discourse-mail-receiver-release-docker-image-appears-to-be-outdated/411734 "2026-09-06T04:30:12Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![scavin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/scavin/32/115938_2.png) [@scavin](https://meta.discourse.org/u/scavin)
#### Post date: [2026 年 9 月 6 日午前 4:30 UTC](https://meta.discourse.org/t/discourse-mail-receiver-release-docker-image-appears-to-be-outdated/411734/1 "2026-09-06T04:30:12Z")

</div>

こんにちは、

公式の `discourse/mail-receiver:release` Dockerイメージが見過ごされているか、かなり長期間再ビルドされていない可能性があります。

GitHubリポジトリは現在も積極的にメンテナンスされています：

> **[GitHub - discourse/mail-receiver](https://github.com/discourse/mail-receiver)**
>
> 通过在 GitHub 上创建帐户来为 discourse/mail-receiver 开发做出贡献。

しかし、公式のDockerイメージ：

```plaintext
discourse/mail-receiver:release

```

は、ほぼ **2年前** にビルドされたもののように見えます。

これにより、現在のDiscourseバージョンとの互換性問題が発生しているようです。

私の場合、受信メールは正常にメールレシーバーに到達しますが、`RCPT TO` 段階で以下のようなエラーで拒否されます：

```plaintext
450 4.7.1 Recipient address rejected: Internal error, API request failed

```

古いDockerイメージは、まだ `smtp_should_reject` / 高速拒否メカニズムを使用しているようです。

しかし、現在のDiscourseソースには次のようなコメントが含まれています：

```ruby
# 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 では、まだユーザーに次のように使用することを指示しています：

```plaintext
discourse/mail-receiver:release

```

したがって、最近の変更後にDockerイメージの公開プロセスが単に漏れてしまったのではないかと考えます。

新しい `discourse/mail-receiver:release` イメージのビルドと公開が必要かどうか、ご確認いただけますでしょうか。

よろしくお願いいたします！

---

<div class="post-metadata">

### Author: ![scavin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/scavin/32/115938_2.png) [@scavin](https://meta.discourse.org/u/scavin)
#### Post date: [2026 年 9 月 6 日午前 5:04 UTC](https://meta.discourse.org/t/discourse-mail-receiver-release-docker-image-appears-to-be-outdated/411734/2 "2026-09-06T05:04:44Z")

</div>

## 更新: 現在の `main` ブランチをテストしました

現在の `main` ブランチをローカルでビルドし、別の問題が見つかりました。

Docker Hub の旧 `release` イメージでは、まだ旧来の fast-rejection コードが実行され、RCPT の段階で以下のエラーが発生します:

```plaintext
450 4.7.1 Recipient address rejected: Internal error, API request failed

```

しかし、現在の `main` ブランチでは、`smtp_should_reject` / fast-rejection の実装がすでに削除されています。`main` をビルドすると、Postfix は代わりに以下で失敗します:

```plaintext
warning: connect to private/policy: No such file or directory
451 4.3.5 Recipient address rejected: Server configuration problem

```

これは `Dockerfile` に残っている2つの参照に起因していることが特定できました:

```plaintext
check_policy_service unix:private/policy

```

ポリシーサービス自体は削除されていますが、`smtpd_recipient_restrictions` がまだそのソケットを参照しています。

`smtpd_recipient_restrictions` から `unix:private/policy` を削除し、イメージを再ビルドしたところ、受信 SMTP メールが正常に受け入れられるようになりました。

Global API Key に切り替えた後、Discourse への配信も成功しました:

```plaintext
dsn=2.0.0, status=sent (delivered via discourse service)

```

したがって、2つの別々の問題があるようです:

1. 公開されている `discourse/mail-receiver:release` イメージは古く、まだ旧来の fast-rejection 実装が含まれています。
2. 現在の `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 を提出できます。

---

<div class="post-metadata">

### Author: ![Ethsim2](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ethsim2/32/522255_2.png) [@Ethsim2](https://meta.discourse.org/u/Ethsim2)
#### Post date: [2026 年 9 月 6 日午前 7:01 UTC](https://meta.discourse.org/t/discourse-mail-receiver-release-docker-image-appears-to-be-outdated/411734/3 "2026-09-06T07:01:50Z")

</div>

#mail-receiver の別の変更で、公開されているリリースイメージが古いことを確認しました。

私はこの PR を作成し、8月11日にマージされました：

> <https://github.com/discourse/mail-receiver/pull/37>
>
> \## 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 に詳細を追加しました：

> <https://github.com/discourse/mail-receiver/pull/37#issuecomment-5316800475>
>
> 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](https://github.com/discourse/mail-receiver/pull/37) の変更が含まれていないため、受信される各メールに対して Discourse の以下のような警告が引き続きトリガーされます：

`the email parameter is deprecated`

したがって、これはあなたが最初に見つけた問題を独立して確認するものと思われます。#mail-receiver リポジトリにマージされた変更が、公開されている `discourse/mail-receiver:release` イメージに反映されていないのです。

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [2026 年 9 月 7 日午前 1:22 UTC](https://meta.discourse.org/t/discourse-mail-receiver-release-docker-image-appears-to-be-outdated/411734/4 "2026-09-07T01:22:02Z")

</div>

社内で議論した結果、このプロジェクトは奇妙な状態にあると同意しています……メンテナンスされているのか、されていないのか、判断が難しいです。

社内の利用には別のイメージを使用しており、このイメージはセルフホスター向けにのみ提供されており、更新が滞ることがよくあります。

ここでDockerの公開を諦めて個人アカウントに移行するのか、それともこのまま維持するのか、検討しています。

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [2026 年 9 月 7 日午前 6:19 UTC](https://meta.discourse.org/t/discourse-mail-receiver-release-docker-image-appears-to-be-outdated/411734/5 "2026-09-07T06:19:39Z")

</div>

この機能を維持してください。必要とされており、比較的多く利用されています。

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2026 年 9 月 7 日午後 2:50 UTC](https://meta.discourse.org/t/discourse-mail-receiver-release-docker-image-appears-to-be-outdated/411734/6 "2026-09-07T14:50:16Z")

</div>

> [@sam](#):
>
> 内部では別のイメージを使用しています。

セルフホスター向けにそのイメージが何らかの形で動作するようになると素晴らしいです。

以前はバウンスを適切に処理し、Discourseにそれらのメールを送信しないよう通知する機能がありましたが、それが恋しくなります。この機能があれば、マルチサイト環境でその仕組みを完全に理解できていないMailgun APIの更新が不要になります。
