Update mail-receiver auf die Release-Version

Wenn Sie hierher gekommen sind, weil Sie diese Meldung in Ihrem Admin-Dashboard bemerkt haben:

Wir haben eine veraltete Version von mail-receiver erkannt.

dann sind Sie am richtigen Ort.

Bitte melden Sie sich per SSH auf Ihrem Discourse-Server an und führen Sie die folgenden beiden Befehle aus, um mail-receiver zu aktualisieren:

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

Weitere Details finden Sie im folgenden Abschnitt.

Warum müssen wir mail-receiver aktualisieren?

Wir müssen mail-receiver auf eine neuere Version aktualisieren, die keine veraltete API-Authentifizierungsmethode mehr verwendet.

Bei der ursprünglichen Einrichtung von mail-receiver wurden Sie aufgefordert, eine Datei containers/mail-receiver.yml zu erstellen, die eine fest codierte Versionsnummer enthielt:

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

Um zukünftige Updates zu erhalten, ohne diese Nummer manuell aktualisieren zu müssen, können Sie die Versionsnummer auf release statt auf eine spezifische Version setzen.

Bitte bearbeiten Sie /var/discourse/containers/mail-receiver.yml, um dieses Basis-Image zu verwenden:

base_image: discourse/mail-receiver:release

Falls gewünscht, können Sie einfach folgenden Befehl ausführen:

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

um die Datei für Sie zu bearbeiten.

Anschließend können Sie folgenden Befehl ausführen:

/var/discourse/launcher rebuild mail-receiver

um auf die neueste Version von mail-receiver zu aktualisieren.

21 „Gefällt mir“

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 „Gefällt mir“

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 „Gefällt mir“

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 „Gefällt mir“

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 „Gefällt mir“

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

2 „Gefällt mir“

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 „Gefällt mir“