mail-receiver をリリースバージョンに更新

このメッセージが管理ダッシュボードに表示されているため、ここへアクセスされた場合は、正しい場所にお越しください。

Discourse サーバーに SSH で接続し、以下の 2 つのコマンドを実行して mail-receiver を更新してください。

sed -i 's/mail-receiver:.*/mail-receiver:release/' /var/discourse/containers/mail-receiver.yml
/var/discourse/launcher rebuild mail-receiver

詳細については、引き続きお読みください。

なぜ mail-receiver を更新する必要があるのですか?

mail-receiver を、非推奨の API 認証方法を使用しない新しいバージョンに更新する必要があります。

mail-receiver を最初にセットアップした際には、ハードコードされたバージョン番号を含む containers/mail-receiver.yml ファイルの作成が求められました。

base_image: discourse/mail-receiver:x.x.x

この数値を手動で更新しなくても今後のアップデートを受け取るためには、バージョン番号を指定する代わりに release に変更してください。

/var/discourse/containers/mail-receiver.yml を編集して、以下のベースイメージを使用するように設定してください。

base_image: discourse/mail-receiver:release

もしよろしければ、以下のコマンドを実行するだけでファイルを編集できます。

sed -i 's/mail-receiver:.*/mail-receiver:release/' /var/discourse/containers/mail-receiver.yml

その後、以下のコマンドを実行して mail-receiver を最新バージョンに更新してください。

/var/discourse/launcher rebuild mail-receiver
「いいね!」 21

Thanks for the update guide @blake! However, I seem to not have the mail-receiver.yml file in /var/discourse/containers/ for some reason.

root@nomadgate-community-eu:/var/discourse# sed -i 's/mail-receiver:.*/mail-receiver:release/' /var/discourse/containers/mail-receiver.yml
sed: can't read /var/discourse/containers/mail-receiver.yml: No such file or directory

For good measure checked typed ls to check what’s actually there:

root@nomadgate-community-eu:/var/discourse/containers# ls
app.yml  app.yml.save

Any idea why there’s no mail-receiver.yml file and what I can do about it? Mail Receiver seems to be working for my community, even without the file…

EDIT: Come to think of it, I don’t think I’ve ever set up “mail-receiver”. I’m using SendGrid’s inbound parse webhook feature, so why am I even seeing this error in my Discourse dashboard?

However, to make that work I am passing the API credentials as URL parameters like so: /admin/email/handle_mail?api_key=xxx&api_username=xxx — will this no longer work? And if so, is there any other way to keep the support for inbound messages via SendGrid?

「いいね!」 2

I agree – I don’t see a containers/mail-receiver.yml file in my Discourse installation. So far I’m not seeing any ill effects.

@dltj Are you also using SendGrid or similar?

Here’s the thing: If you didn’t install the mail receiver you don’t need to upgrade it.

「いいね!」 2

Sure but I’m trying to gather as much info as I can because there may be some changes to query param based api calls depending on support from SendGrid or other providers that you can wire up to use this endpoint.

「いいね!」 3

No, I’m not using SendGrid – this Discourse installation is several years old, and at the time I wrote an AWS Lambda that used the /admin/email/handle_mail API to push incoming mail into Discourse. That Lambda script used Python 2.7, so it is due for a rewrite…probably time to see what my options are now.

Oddly, the “We detected an outdated version of mail-receiver…” is no longer on my Discourse admin dashboard. Huh. Scratch that – the message is still there. Maybe it went away because the Discourse install didn’t receive any inbound messages for a few days on the /admin/email/handle_mail endpoint, but it did when I sent the test message?

Just checked – inbound mail to Discourse still works.

「いいね!」 1

Correct. It times out after 24hrs if it hasn’t received any messages.

「いいね!」 2

Ah, I see. So the dashboard warning isn’t that I’m using ‘mail-receiver’…it is that I’m using the now deprecated api_key and api_username as query params to the API endpoint. Okay…simple enough to fix. Thanks for the hints.

「いいね!」 3