E-Mail-Blacklist: Frage zum Massendatenlöschungen/Deaktivieren

Nachdem die Domains auf die schwarze Liste gesetzt wurden, bleiben die bereits registrierten Konten unbeeinträchtigt und können weiterhin genutzt werden.

Ich möchte fragen, ob jemand eine Möglichkeit kennt, Benutzer basierend auf ihrer Registrierungs-E-Mail-Domain massenhaft zu löschen (Benutzer plus allen deren Inhalten), zu sperren oder stummzuschalten?

In meinem Fall würde dies das Löschen/Deaktivieren von Hunderttausenden von Konten ermöglichen, die die Catchall-Domain-Technik zur Registrierung genutzt haben.

Was this migrated data? Deleting that many accounts is going to be very, very painful – unless they all have almost no content.

1 „Gefällt mir“

You can do it from the rails console, but it does sound like it could be very messy.

1 „Gefällt mir“

@codinghorror - It’s not migrated data. I don’t mind painful and slow as the alternative of allowing the accounts to stay is probably worse :hot_face: For amounts of content, it’s a mix, some have none (usually the spammers intend to use these accounts later), some have minimal, some have heaps.

@pfaffman Great! Do you know how? Haha :pray:

1 „Gefällt mir“

Have you given a thought to anonymizing the users?

1 „Gefällt mir“

@fzngagan That might be a solid solution. Know if there a way to do this in bulk?

1 „Gefällt mir“

Yes. It can be done from the rails console. But the question is, on what criteria do you want to anonymize them?

1 „Gefällt mir“

@fzngagan Great! The criteria would be, all emails that use a specific domain in their registration email. E.g. example@blacklisted.com, example2@blacklisted.com

1 „Gefällt mir“

In rails console, type these commands and see if they give expected results(replace you email id pattern with ‘@gmail.com’)

idlist = UserEmail.where("email like '%@gmail.com'").pluck(:user_id)
users = User.find(idlist)

then (proceed with caution)

system_user = Discourse.system_user
users.each do |user|
  UserAnonymizer.new(user, system_user).make_anonymous
end

I’m not an expert in performance related stuff, so I don’t know exactly what would happen if number of users is big.

2 „Gefällt mir“

@fzngagan Wow nice, thanks heaps! :slight_smile: I really appreciate it.

I’ll make sure everything is recently backed up before giving this a shot.

Quick question, do you know if bulk silencing the users (forever) using this technique is possible?

1 „Gefällt mir“

Yes. Rails console can do mostly everything that can be done from code.

2 „Gefällt mir“