In a test harness, I am trying to verify that a certain identifier appears in an email message. The message has been parsed from a file using Python’s built-in email.message_from_file() method.
When I retrieve the message content using get_payload, it is broken across several lines and includes line continuation markers (the = character as the last character in the line). Unfortunately, the identifier I am looking for is split across a line break.
While I could change the textual part of message to avoid the identifier getting split, I would prefer to find a good mechanism to recombine the continued lines and recover the original string. Can anyone suggest a good way to do so?
1 Answer