comparison src/plugins/plugin_misc_smtp.py @ 574:89f9a50ce7bf

core, plugin imap, plugin smtp: fixed SMTP/IMAP integration. /!\ Profile need to be connected for IMAP server to work (will change in the future)
author Goffi <goffi@goffi.org>
date Tue, 08 Jan 2013 00:46:38 +0100
parents 2a072735e459
children 952322b1d490
comparison
equal deleted inserted replaced
573:db7a03a33612 574:89f9a50ce7bf
89 def eomReceived(self): 89 def eomReceived(self):
90 """handle end of message""" 90 """handle end of message"""
91 mail = Parser().parsestr("\n".join(self.message)) 91 mail = Parser().parsestr("\n".join(self.message))
92 try: 92 try:
93 self.host.sendMessage(parseaddr(mail['to'].decode('utf-8','replace'))[1], mail.get_payload().decode('utf-8','replace'), #TODO: manage other charsets 93 self.host.sendMessage(parseaddr(mail['to'].decode('utf-8','replace'))[1], mail.get_payload().decode('utf-8','replace'), #TODO: manage other charsets
94 subject=mail['subject'].decode('utf-8','replace'), type='normal', profile_key=self.profile) 94 subject=mail['subject'].decode('utf-8','replace'), mess_type='normal', profile_key=self.profile)
95 except: 95 except:
96 exc_type, exc_value, exc_traceback = sys.exc_info() 96 exc_type, exc_value, exc_traceback = sys.exc_info()
97 error(_("Can't send message: %s") % exc_value) #The email is invalid or incorreclty parsed 97 error(_("Can't send message: %s") % exc_value) #The email is invalid or incorreclty parsed
98 return defer.fail() 98 return defer.fail()
99 self.message=None 99 self.message=None