The discussion centers on a bug where Discourse rejects emails from known users who lack permission to post in a private category, while accepting emails from anonymous users. The original reporter, downey, outlines that emails from unregistered addresses work, but those from registered non-members are rejected with a can_create? failed error. zogstrip confirms this is intentional behavior: the system associates the email with the user first, then checks permissions. Since the user is not in the allowed group, the post is blocked. The email_in_allow_strangers setting currently only applies to staged (unactivated) users.
Several users, including wityr and Christian_Kindel, argue this is counter-intuitive and problematic, especially for mailing list mirrors where known subscribers are blocked while unknown senders are accepted. dachary proposes code patches to bypass validation when email_in_allow_strangers is enabled, though sam explains that the current restriction is a security measure to prevent email spoofing and impersonation. Sam suggests a long-term solution involving a verification step where the user confirms the email was sent by them.
Other participants, such as Simon_Manning, argue that modern email authentication protocols like SPF, DKIM, and DMARC provide sufficient protection against spoofing, suggesting that the system could safely accept emails from known users if these checks pass. sam considers adding a site setting to allow operators to accept this risk. Simon_Manning further clarifies that the issue is specific to private categories; in public categories, known users with permissions can post via email without issue. The consensus among developers is that fixing this requires a comprehensive approach to security, potentially leveraging email authentication results to allow known users to post in restricted categories without compromising safety against impersonation. The issue persists in recent versions, affecting projects like the Tor Forum that rely on email-to-forum functionality.
Have a “private” category that only has create/reply/see access for members of a specific group. No other permissions.
Enable “anonymous email in” for that specific via a unique working alias to the incoming POP account.
Have a non-staff user that is not a member of the group send an email report in to the category email address from the email address associated with their account.
Send in an email from an account not associated with any known Discourse account.
Expected Behavior:
Both #3 and #4 result in new topics in the private category, and the group can begin discussion.
Actual Behavior:
The email in #4 works but email in #3 is rejected with the can_create? failed error.
When we receive an email, we first try to associate it to a user, and then we check for permissions. Since the user isn’t part of the group, they can’t post.
The email_in_allow_strangers field on the category only works for staged users.
Can confirm #3 still not working. Is the best workaround right now to have emails directed at a group rather than a category? Not my preferred arrangement but I can switch until a patch comes out.
This scenario seems to be replaced these days with the group functionality as a type of workaround, although I could see some use cases that it might still be just as valuable for categories/topics/discussions.
Like you say, this is just a (bad) workaround. IMO this should be controllable on a per-category level. Clearly a bug that this works only for anonymous but not for known users.