0

I'm using Getmail (http://pyropus.ca/software/getmail/) to check a POP3 account regularlly and download arriving mail to a folder.

On a second step I parse those mails using Python and use the sent data.

The problem is that, as the received mails are in spanish, latin characters may arrive and when saved to a file they are replaced. I can't find how to avoid that replacement or even which encoding the file is in. Examples follow:

  • Ñ is replaced by =F1
  • á is replaced by =E1
  • Line breaks are replaced by =20

It looks like URL encoding but it uses the = sign instead of the %.

I also tried to download the mails using Python's poplib and I also get the characters replaces, that leads me to think that the problem can be a configuration on my machine.

Hope someone can help me with this.

Thanks!!

Martin
  • 660
  • 10
  • 23
  • 1
    To be clear, neither getmail nor poplib *replaced* anything. The `=F1`, etc, were in the mail all along. When rendered by a suitable MUA, those sequences appear as Ñ, etc. Such sequences are evidence that the mail was encoded using [quoted-printable](https://en.wikipedia.org/wiki/Quoted-printable) encoding. – Robᵩ Mar 11 '16 at 15:22
  • 1
    that's quoted-printable encoding. https://en.wikipedia.org/wiki/Quoted-printable – Marc B Mar 11 '16 at 15:24
  • What program do you use to display the email messages after they are downloaded? – Robᵩ Mar 11 '16 at 15:24
  • As @MarcB and Rob tells thos characters are quoted-printable. Yesterday I banged my head to a wall looking for the solution, today right after submitting the question I found the solution. I had to use this package https://docs.python.org/3.4/library/quopri.html with the input from the mail body. Thanks anyways!! – Martin Mar 11 '16 at 15:35

0 Answers0