自動グループメンバーシップから特定のメールサブドメインを除外する

I’m looking at the automatic group membership setting (in group settings). It states

Users who register with an email domain that exactly matches one in this list will be automatically added to this group:

Am I correct in assuming that entering bar.com will also trigger membership for emails ending in foo.bar.com? Or is the word “exactly” meant to state that exactly that is not the case?

Assuming that my assumption is correct, I’m looking for a solution for the following:

Goal: All employees (and only employees) of a university should automatically get membership in the group employees .

Strategy: Use the university’s domain uni.edu in the above setting to automatically assign membership

Problem: Student email-addresses also end in uni.edu but they should not get access to the group.

Possible solution: If I could exclude student.uni.edu from getting automatic membership, that should work, but I believe this is currently not possible. Or am I missing something? Any smart workarounds?

「いいね!」 1

It already works that way.

It matches the full domain after the @, so when you configure your group to automatically assign membership for uni.edu it will match foo@uni.edu, but not foo@student.uni.edu

「いいね!」 4

Ah, okay, then my assumption was wrong. But then my issue is another one: I need some sort of catch-all for *.uni.edu because it is impossible to predict the exact sub-domain of an employees email-address. Some have uni.edu, but many have various subdomains like sociology.uni.edu, depending on their departmental affiliation or what they chose as their main affiliation or whatever other determinants there may be.

Is there any way to catch all of these without being able to provide a full list of all possible sub-domains?

Unfortunately that’s currently not possible.

What would it take to create a plugin/PR that would make *.uni.edu work, i.e. that it would catch all users with an email address ending in uni.edu, regardless of whether there is a subdomain or not? My hunch is that it should be pretty easy (read: I might be able to do it), but maybe I’m wrong?

「いいね!」 4

Sure, I think a PR that adds support for wildcards would be fine.

Search for automatic_membership_email_domains in the code if you want to give this a try. It’s used in a couple of files.

「いいね!」 5

Gerhard さん、この機能に関するプルリクエストは作成されましたか?すべての新しい Discourse ID が特定のグループに割り当てられるように、フロントエンドから簡単に管理できる方法が欲しいのです。

例えば、「このグループに作成する際に、このリストと完全に一致するドメインで登録したユーザーを自動的に追加する」というフィールドにワイルドカード文字「*」を指定するだけで、メールアドレスに関係なくすべての新規ユーザーがそのグループに参加するように設定したいと考えています。

「いいね!」 1

「すべてのユーザー」を含むグループの、正確にはどんな意味があるのでしょうか? :thinking:

意図は、複数のグループが存在し、それぞれが異なるドメインに関連付けられることだと考えられます。特定のドメインに一致するすべてのユーザーは、そのグループに割り当てられます。

使用例として、特定の組織に関連するグループを自動的に作成し、そのグループのメンバーがその組織に exclusively に所属していることを把握できるようにするというケースがあります。これは私のコミュニティにとって有用です。

いいえ、具体的に何が言われたか注意してください:

関連するテキストを太字にしました。

「いいね!」 5