domains with generic second-level-domains like ac.at. should be interpreted like toplevel domains.

This commit is contained in:
Denis Knauf 2022-10-04 18:30:39 +02:00
parent 0274e0d299
commit 4fa76393e6

View file

@ -24,9 +24,9 @@ metrics = OpenStruct.new(
def determine_domain str
case str
when /@([^.]+\.[^.]+)\z/
when /@([^.]+\.(?:(?:co|ac)\.)?[^.]+)\.?\z/
$1
when /\.([^.]+\.[^.]+)\z/
when /\.([^.]+\.(?:(?:co|ac)\.)?[^.]+)\?.\z/
"any.#$1"
when 'MAILER-DAEMON'
'MAILER-DAEMON'