Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python email get values for multiple headers of the same name

I'm using python's email.message_from_string to parse a raw email message. However, the message has multiple "Recieved" headers in it. When I call message.keys() their are clearly several Recieved headers. But when I try message.get("Recieved") I just get "" a null string. How do you get the values of those instances of that header?

like image 864
john-charles Avatar asked Dec 04 '25 10:12

john-charles


1 Answers

get_all(name[, failobj])

Return a list of all the values for the field named name. If there are no such named headers in the message, failobj is returned (defaults to None).

Source: http://docs.python.org/library/email.message.html#email.message.Message.get_all

like image 128
wim Avatar answered Dec 05 '25 22:12

wim



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!