Hi i was looking for a way to verify the domain with a provided email address The domain names can be http://www.test.free.com http://www.free.com.au http://www.free.com.au.org http://www.free.com.org or there can be a domain name with any number of sub sub domains and any number of verifications.
the verifying email should contain the domain and this is what i wrote so far
if domain_url is not None and verification_email is not None:
logging.info('==============================')
logging.info('BOTH WERE NOT NONE')
logging.info('==============================')
domain_email = verification_email.split('@')[1].split('.')[0]
logging.info('==============================')
logging.info(domain_email)
logging.info('==============================')
verify_domain_url_list = domain_url.split('.')
if len(verify_domain_url_list) == 4:
verify_domain_url_list.pop()
verify_domain_url_list.pop()
if len(verify_domain_url_list) == 3:
verify_domain_url_list.pop()
verify_status = domain_email in verify_domain_url_list
if verify_status:
return 'yes'
else:
pre_domain_address = verify_domain_url_list[0].split('//')[1]
if pre_domain_address is not None and \
domain_email in pre_domain_address:
return 'yes'
else:
return 'no'
return 'no'
but this not matching for all the possibilities. can any one give a help?