リプライメールからのエラーメッセージに困惑

This might just be a personal failing, but I’m a bit confused by some of the error reporting I’m getting after setting up reply-by-email.

When someone replies to a message from an e-mail address not associated with their account, the error message (on a self-hosted Discourse instance) might be the wrong one? It seems like the message one should receive if they sent to an incorrect address, rather than from an unrecognized address.

The message I receive in that case has the subject line Email issue – Unknown To: Address, and the body looks like:


We’re sorry, but your email message to [“SNIP”] (titled Re: Help Please) didn’t work.

None of the destination email addresses are recognized, or the Message-ID header in the email has been modified. Please make sure that you are sending to the correct email address provided by staff.


Changing the From: address in my replies to match the one associated with the account seems to fix the problem.

Is there an easy way to modify this behavior? Have I misconfigured something?

(I should maybe say that what I would really be hoping for is an option to ignore the From: header altogether and instead just use the reply key as discussed here; is there any chance of that?).

「いいね!」 1

Ah, maybe this is because it’s a response to a PM, rather than a public topic, and so Discourse doesn’t think that the person sending the e-mail (which it doesn’t recognize as a valid user) should be able to send to that address?

That might explain why it is marking the To: address as invalid, rather than the From: address?

In the meantime, I’ve changed the text of that message to clarify that it could be an issue with From: or with To:.

「いいね!」 4

Why would Discourse accept a random email address, not matching any valid user account on the target site? :thinking:

You must always have a valid, authenticated account to post anything in Discourse.

(There is an exception for staged users, but that’s specific to handling an email inbox through Discourse PMs)

「いいね!」 3

This would be because the permission error is transformed into a “not found” error somewhere in the stack, and then the email code uses the message for “not found”…

「いいね!」 3

One could argue that the reply_id (which seems to map both to a topic and the person replying) is identifier enough, and spoofing reply_id is harder than spoofing an e-mail address, so it’s effectively just as strong with or without coming from the right e-mail address.

But I’m not actually trying to argue that. What you’re saying here makes total sense. And, after thinking on it, I realize that the thing leading to this behavior is definitely an edge case (we have SSO creating an account with university e-mail addresses, but people sometimes forward those to other addresses, from which they respond).

My real question is about the contents of the error email people receive in that case, which seems like it could be misleading. The real issue, or at least the thing the person receiving the error e-mail has control over in this case, is the “From” address (and the address associated with their account), not the “To” address, as far as I can tell.

Anyway, I already have a workaround by:

  • changing the content of that message (love that Discourse is so customizable!) and
  • telling people to change their email address if they want to use reply-by-email

but I’m just wondering if it makes sense to change something about what error messages are sent in which situations, given this potential confusion.

If the answer to that is “No, things are fine as-is,” that’s totally fine.

「いいね!」 4

We do have preliminary support for alternate email addresses per user.

I wonder @sam and @eviltrout when will we formalize this a bit more so users can add a secondary email address? Should this be added to the 2.5 roadmap?

「いいね!」 10

I think we should start by surfacing this in the admin user page so you can see / add email addresses for 2.5. Maybe next after that add some rudimentary UX in the admin pages for merging users now that we have the well tested rake task.

「いいね!」 8

We’d have to validate each address right?

「いいね!」 5

Discourse が、極めて容易に偽装可能な From: ヘッダーを信頼・検証する理由がいまだに理解できません。

Reply-Id ヘッダーは、悪意のある人物が推測・把握できないため、有用な検証手段となります。

From: ヘッダーを検証するだけでは、異なるメールアドレスから返信した場合(予想以上に一般的なエッジケース)に、正当なユーザーがメールによる投稿で混乱を招く拒否を受け、困惑することになります。

「いいね!」 1

メールはアイデンティティです。「異なるメールアドレス」とは、「異なる DNA」と言っているのと同じです。

「いいね!」 1

私は多くのメールアドレスを持っており、私のユーザーの中にも同じような人がいます。

ここで喧嘩をふっかけようとしているわけではありません。単に、この問題で少し傷ついているだけです。なぜなら、この問題が私のフォーラムの重要なメンバーの一人が、もう貢献しないことを選ぶ原因となったからです。

それなら、ユーザーあたりの複数メールアドレス設定の進展を訴えるべきでしょう。上にスクロールして、少し読んでみるのはどうですか?

「いいね!」 2

残念ながら、提案されている機能が私の Discourse インスタンスで発生している問題を解決できるかどうかはわかりません。

私のケースでは、そのユーザーは市民団体の会長です。彼女は 2 つのメールアドレスと、それぞれに対応する 2 つの Discourse アカウントを持っていました。1 つは個人のアイデンティティを表し、もう 1 つは市民団体 behalf での「公式」投稿用でした。

彼女はメールで返信する際、頻繁に「間違った」メールアドレスから返信してしまい、その結果返信が拒否されていました。

上記で議論されている機能は、1 つの Discourse アカウントに複数のメールアドレスを割り当てることを想定していると思われますが、当然ながら 1 つのメールアドレスに複数の Discourse アカウントを割り当てることは許可しないでしょう。したがって、残念ながら私のユースケースには対応できないと思われます。

「いいね!」 1

アカウントを統合して、一方のメールアドレスをセカンダリにすることはできませんか?

できない場合、残念ながら現在Discourseには、ユーザーがどの「帽子」を被っているかを思い出させるためのツールはありません。

「いいね!」 1

技術的には可能ですが、ユーザーが2つの異なるアイデンティティ(個人/市民社会を代表して)で投稿できるようにすることは意図的な設計です。

「いいね!」 2

はい。確かに、そのような状況に陥る人もいますが、これは「エッジケース」というより「コーナーケース」と呼ぶべきかもしれません :smile:

この人は実質的に 2 つのアイデンティティを持っているが、何らかの理由で両方が同じメールアカウントに集約されてしまっている、という理解で合っていますか?もしそうなら、Discourse だけでなく、他の場所でも同様の問題に直面しているはずです。もしかすると、メールクライアント側で処理した方が適しているケースかもしれません。

私も仕事用のメールアカウントに業務関連のエイリアスを持っていますが、クライアントは返信先の「From」アドレスを、メールが送られてきたアドレスに一致させるようになっています…

「いいね!」 4

同意します。これは特殊なケースであり、もし彼女がそれほど著名なユーザーでなかったなら、それほど大きな問題にはならなかったでしょう。

Discourse アカウントを 2 つ作成するために、Gmail のドットハックを使用し、彼女が Gmail の受信トレイに 2 つのメールアドレスを作成できるようにしました。その結果、彼女は 2 つの Discourse アカウントを作成できました。

彼女がフォーラムの投稿にメールで返信する際、Gmail は必ずしも Discourse が期待するメールアドレスのバリアントを使用するとは限りません。

私の考えでは、返信 ID が有効であれば、Discourse はその返信を受け入れるべきです。

ドットハックは非常に脆弱で、代わりにプラスアドレスを使ったほうがはるかに快適に使えるでしょう。

両方のアカウントがプラスアドレスを使用し、裸のアドレス(プラス記号なしのアドレス)を直接使用するアカウントがない場合、From: アドレス切り替え機能は正常に動作します。切り替えの設定を忘れたとしても、メールが誤ったアカウントに送信されるのではなく、単に拒否されるだけになります。

ドットではなくプラス記号を使うことで、フィルタの設定もはるかに明確になりますね :sweat_smile:

「いいね!」 7

dan さん、これをあなたのリストに追加してくれますか?

「いいね!」 5

複数のメールアドレスのサポートを改善するプルリクエストを提出しました:

「いいね!」 8