Closed pbchase closed 1 year ago
In that example above, use these lines instead:
emails_by_subject_search <- imap_con$search_string(expr = "TBD SUBJECT", where = "SUBJECT")
emails_by_since_search <- imap_con$search_since(date_char = format(messages_since_date, format = "%d-%b-%Y"))
emails_found <- dplyr::intersect(emails_by_subject_search, emails_by_since_search)
We need a function to identify bad email addresses based on bounce messages in an email inbox. This function would work much like
get_bad_emails_from_listserv_digest
, but use different pattern matching to locate the messages that document bounces and the email address identified within them. CTS-IT wrote some similar code for its billing processes. I have hacked that into a starter function:I don't recall the patterns that identify a bounce message or the patterns that extract the address from the body.