My forum has a lot of imported users that have a specific email domain that doesn’t work anymore.
A few thousand users have such an email address.
It was not an issue until now, but I increased suppress digest email after days value, and my forum sent a lot of digest emails, including to a lof of users having non-working email domains.
It led to too many bounces and mailgun disabled my domain.
What should I do with these accounts to prevent this and fix my issue? A lot of these accounts belong to legit users that didn’t come back to the forum yet. There are not necessarily abandoned accounts.
Because of this issue, users can’t register to the forum until it is fixed.
as described in Replace a string in all posts. That will make all of those email addresses such that Discourse won’t send to them. Another good solution would be something like
bad=User.find_by_email <some search that will get them all>
bad.update_all(active: false)
and deactivate all of the users with the known bogus email addresses. Not quite sure how to do the first bit off the top of my head, but it should be easy enough to figure out.
Are these two different “dummy domains” both ignored when Discourse must send emails?
Should I replace my non-working domain with @no-email.invalid or @email.invalid, or it doesn’t matter?
@pfaffman, I’m not sure to understand why I should remap in posts instead of changing the user emails… These email addresses aren’t in posts, unless I’m missing something.
If it is a recommended way, I’d just like to replace my @brokendomains.com addresses in each profile by @no-email.invalid or @email.invalid. I can figure out how to do this, I just wonder which “fake” domain to use.
UserEmail.where("email like '%@brokendomain.com'").each do |e|
e.update(email: SecureRandom.hex + "@email.invalid)
end
Yours could work too, but Im’ not sure if the User model got updated to be able to do a u.email.include? after they moved emails to another model/table.
Thank you. This is the one I used.
More than 5000 users of a total of 17000 users had such email domains. No wonder the number of bounces when I increased suppress digest email after days…