mirror of
https://github.com/PC-Admin/matrix-moderation-tool.git
synced 2024-12-19 23:20:26 -05:00
fix bug where a single whois email is returned as an array of letters.
This commit is contained in:
parent
df4d2ca3ab
commit
f5fd56860d
@ -264,13 +264,17 @@ def lookup_homeserver_admin(preset_baseurl):
|
|||||||
try:
|
try:
|
||||||
w = whois.whois(baseurl)
|
w = whois.whois(baseurl)
|
||||||
if w.emails:
|
if w.emails:
|
||||||
#print("\nAdmin contact email(s) for " + baseurl + " are: " + str(w.emails))
|
# Check if the emails field is a list
|
||||||
|
if isinstance(w.emails, list):
|
||||||
return {baseurl: list(w.emails)}, True
|
return {baseurl: list(w.emails)}, True
|
||||||
|
# If it's not a list, it must be a single string. So, we wrap it in a list
|
||||||
else:
|
else:
|
||||||
print(f"Error: Unable to collect admin email from WHOIS data for {baseurl}")
|
return {baseurl: [w.emails]}, True
|
||||||
|
else:
|
||||||
|
print(f"\t\tError: Unable to collect admin email from WHOIS data for {baseurl}")
|
||||||
return None, False
|
return None, False
|
||||||
except:
|
except:
|
||||||
print(f"Error: Unable to collect WHOIS data for {baseurl}")
|
print(f"\t\tError: Unable to collect WHOIS data for {baseurl}")
|
||||||
return None, False
|
return None, False
|
||||||
|
|
||||||
def send_email(email_address, email_subject, email_content, email_attachments):
|
def send_email(email_address, email_subject, email_content, email_attachments):
|
||||||
|
Loading…
Reference in New Issue
Block a user