I am not sure if this is the right forum to ask, but I give it a try. 
A device is sending an E-Mail to my code in which I am trying to receive the email via a socket in python, and to decode the E-Mail with  Messsage.get_payload() calls. However. I always have a \n.\n at the end of the message. 
If the same device send the same message to a genuine email client (e.g. gmail), I get the correct original message without the \n.\n. 
I would like to know what it is with this closing set of special characters in SMTP/E-Mail handling/sending, and how to encode it away.
These are simply newline characters. In GMail they'll be processed and "displayed" so you don't see them. But they are still part of the email text message so it makes sense that get_payload() returns them.
Mysterious characters at the end of E-Mail, received with socket in python