force convert header to string if needed
This commit is contained in:
parent
c847d205b6
commit
c36870daa8
|
@ -305,9 +305,10 @@ def generate_reply_email():
|
|||
def should_append_alias(msg: Message, address: str):
|
||||
"""whether an alias should be appended to TO header in message"""
|
||||
|
||||
if msg["To"] and address.lower() in msg["To"].lower():
|
||||
# # force convert header to string, sometimes addrs is Header object
|
||||
if msg["To"] and address.lower() in str(msg["To"]).lower():
|
||||
return False
|
||||
if msg["Cc"] and address.lower() in msg["Cc"].lower():
|
||||
if msg["Cc"] and address.lower() in str(msg["Cc"]).lower():
|
||||
return False
|
||||
|
||||
return True
|
||||
|
|
Loading…
Reference in New Issue