Commit a684d0ed authored by Claudemir Todo Bom's avatar Claudemir Todo Bom

* fix junkreport

parent 28fd3b12
Pipeline #179 passed with stage
in 5 minutes and 39 seconds
......@@ -114,7 +114,7 @@ class MessageData(dict):
dataDict["to"] = self.processAddressList(dataList[5])
dataDict["cc"] = self.processAddressList(dataList[6])
dataDict["bcc"] = self.processAddressList(dataList[7])
dataDict["in-reply-to"] = self.processAddressList(dataList[8])
dataDict["in-reply-to"] = dataList[8]
dataDict["message-id"] = dataList[9]
return dataDict
......@@ -129,7 +129,12 @@ class MessageData(dict):
def processAddress(self, addressData):
address = dictAddress()
address["name"] = wwMailUtils.decode_header(addressData[0])
address["address"] = addressData[2]+"@"+addressData[3]
tmpadd = ""
if addressData[2] != None:
tmpadd = tmpadd + addressData[2]
if addressData[3] != None:
tmpadd = tmpadd + "@"+addressData[3]
address["address"] = tmpadd
return address
class MessageArray:
......@@ -193,7 +198,7 @@ class JunkReport:
self.addHtmlTemplate(u"%(htmlboxon)s%(htmlpreon)s")
if msgInfo["imap.envelope"]["date"] != None:
self.addTextTitleValue(u"Data/Hora", time.strftime("%c",time.localtime(msgInfo["imap.envelope"]["date"])))
self.addTextTitleValue(u"Data/Hora", time.strftime("%c",time.localtime(msgInfo["imap.envelope"]["date"])).decode("utf-8"))
self.addTextTitleValue(u"Remetente", msgInfo["imap.envelope"]["from"][0].formatAddress())
self.addTextTitleValue(u"Assunto" , msgInfo["imap.envelope"]["subject"])
......
......@@ -26,7 +26,7 @@ def decode_header ( header ):
final = final+" "
started = 1
if charset:
final = final+unicode(part,charset)
final = final+unicode(part,charset,"ignore")
else:
try:
final = final+unicode(part,"utf-8")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment