def email_is_not_mit_mailing_list(email):
 if ('@mit.edu' in email):
  username = email.rsplit('@', 1)[0]
  try:
   DNS.dnslookup(('%s.pobox.ns.athena.mit.edu' % username), DNS.Type.TXT)
  except DNS.Base.ServerError as e:
   if (e.rcode == DNS.Status.NXDOMAIN):
    raise ValidationError(mark_safe(MIT_VALIDATION_ERROR))
   else:
    raise

def email_is_not_mit_mailing_list ( email ) : if ( '@mit.edu' in email ) : username = email . rsplit ( '@' , 1 ) [ 0 ] try : DNS . dnslookup ( ( '%s.pobox.ns.athena.mit.edu' % username ) , DNS . Type . TXT ) except DNS . Base . ServerError as e : if ( e . rcode == DNS . Status . NXDOMAIN ) : raise ValidationError ( mark_safe ( MIT_VALIDATION_ERROR ) ) else : raise
prevent mit mailing lists from signing up for zulip .