diff --git a/mail/lan_mail_helper.py b/mail/lan_mail_helper.py index 0a8e2ec..3e2c41e 100644 --- a/mail/lan_mail_helper.py +++ b/mail/lan_mail_helper.py @@ -41,6 +41,17 @@ def check_mail(mail: str): print(res.text) +def check_appointment_link_mail(mail: str): + print("check_mail called for {}".format(mail)) + _time = str(int(time.time() * 1000)) + _hermes_mail = HERMES_EMAIL + _subjet = "Votre demande de rendez-vous" + _api_info = host + "&act=checkMail&email={}&from={}&title={}&t={}".format(mail, _hermes_mail, _subjet, _time) + print(_api_info) + res = requests.get(_api_info, verify=False) + print(res.text) + + def get_account(mail: str): _time = str(int(time.time() * 1000)) _api_info = host + "&act=getAccount&email={}&t={}".format(mail, _time) @@ -93,6 +104,20 @@ def check_all_need_to_check_emails(): find_links_to_validate_from_mail_list(_mail_list, logger) +def try_to_check_all_mails(): + logger = logging.getLogger() + _mail_list_before_filter = get_mail_list_to_check() + _mails = filter_mail_with_links(_mail_list_before_filter) + for _mail in _mails: + if "outlook.com" in _mail or "hotmail.com" in _mail: + check_appointment_link_mail(_mail) + time.sleep(2) + _mail_list = [MailAddress("saigecong1990@pissmail.com", "cvExXKOP8oY1D@")] + find_links_to_validate_from_mail_list(_mail_list, logger) + + if __name__ == '__main__': # check_all_need_to_check_emails() - check_confirmed_mails() + try_to_check_all_mails() + # check_confirmed_mails() + # check_appointment_link_mail("hcunlvi533@outlook.com") diff --git a/mail/mail_reader_all_contacts.py b/mail/mail_reader_all_contacts.py index d97f442..5e65787 100755 --- a/mail/mail_reader_all_contacts.py +++ b/mail/mail_reader_all_contacts.py @@ -244,6 +244,8 @@ def need_to_valid_url(url: str, item: Union[ReserveResultPojo, None]) -> bool: def need_to_check_email(mail: str, successful_items) -> bool: print("successful_items size is " + str(len(successful_items))) + if mail =="saigecong1990@pissmail.com": + return True filtered_items = list(filter(lambda item: item.email == mail, successful_items)) # has validated value if len(filtered_items) > 0: