def printBody( self, message, body, cstr ):
if message.has_key('Content-Transfer-Encoding') and message.get('Content-Transfer-Encoding')=='base64':
try:
body = base64.b64decode(body)
#cstr.write('decoded base64 successfully' + '\n')
except:
cstr.write('WARNING - could not decode base64' + '\n')
#pj suggested improvement by vragosta to get rid of occasional " =20" at end of lines.
#cstr.write(body + '\n')
cstr.write(quopri.decodestring(body) + '\n')
# -------------------------------------------------
# Get and print to STDOUT the mail message
# -------------------------------------------------
评论列表
文章目录