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

master
Denis Knauf 2022-10-04 18:30:39 +02:00
parent 0274e0d299
commit 4fa76393e6
1 changed files with 2 additions and 2 deletions

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'