[Pymilter] Python3: how to proceed
Stuart D. Gathman
stuart at gathman.org
Mon Oct 17 20:58:44 EDT 2016
The sample.py milter is working in python3 now. Here are
some bytes/str decisions that have to be made moving to python3.
The connect callback gets a hostname - this is still a str.
What do you think? Make that bytes also?
The helo callback gets whatever the SMTP client sends for hostname.
Should probably be bytes.
The header callback is getting str. I'm thinking that header should
also get bytes, although that will mean adding some code changes for
existing milters (e.g. 'foo' -> b'foo'). The header name and value
passed to header callback are not decoded - although milters are always
free to depunycode for instance.
The body callback gets passed bytes now.
The unknown callback (commands MTA doesn't recognize) is still a str.
Change to bytes?
milter.Context.getsymval currently returns str. The MTA is actually passing
null terminated bytes. Change that?
--
Stuart D. Gathman <stuart at gathman.org>
"Confutatis maledictis, flamis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.
More information about the Pymilter
mailing list