#4845 Fix getting the milter running with python3
Merged by pingou. Opened by pingou.
fix_milter  into  master

Download 4845.patch

Turns out the file descriptor we're recieving is in bytes while
email_from_file expects a unicode stream in python3.
So if we run the code using python3, use email_from_binary_file
and it's is python2, keep using the email_from_file.

We also need to encode all strings to bytes before it's passed on to
hashlib.

Signed-off-by: Pierre-Yves Chibon pingou@pingoured.fr

:thumbsup:

rebased onto 5bb82865466f650500920a477dd0aed30e80744f

Pull-Request has been merged by pingou

Metadata