comparison src/plugins/plugin_misc_smtp.py @ 1409:3265a2639182

massive (preventive) addition of 'u' (unicode) before the strings passed to logging functions
author souliane <souliane@mailoo.org>
date Thu, 16 Apr 2015 14:57:57 +0200
parents 72f25d671368
children 2daf7b4c6756
comparison
equal deleted inserted replaced
1408:8a7145138330 1409:3265a2639182
89 try: 89 try:
90 self.host._sendMessage(parseaddr(mail['to'].decode('utf-8', 'replace'))[1], mail.get_payload().decode('utf-8', 'replace'), # TODO: manage other charsets 90 self.host._sendMessage(parseaddr(mail['to'].decode('utf-8', 'replace'))[1], mail.get_payload().decode('utf-8', 'replace'), # TODO: manage other charsets
91 subject=mail['subject'].decode('utf-8', 'replace'), mess_type='normal', profile_key=self.profile) 91 subject=mail['subject'].decode('utf-8', 'replace'), mess_type='normal', profile_key=self.profile)
92 except: 92 except:
93 exc_type, exc_value, exc_traceback = sys.exc_info() 93 exc_type, exc_value, exc_traceback = sys.exc_info()
94 log.error(_("Can't send message: %s") % exc_value) # The email is invalid or incorreclty parsed 94 log.error(_(u"Can't send message: %s") % exc_value) # The email is invalid or incorreclty parsed
95 return defer.fail() 95 return defer.fail()
96 self.message = None 96 self.message = None
97 return defer.succeed(None) 97 return defer.succeed(None)
98 98
99 def connectionLost(self): 99 def connectionLost(self):
198 def startedConnecting(self, connector): 198 def startedConnecting(self, connector):
199 log.debug(_("SMTP server connection started")) 199 log.debug(_("SMTP server connection started"))
200 smtp.SMTPFactory.startedConnecting(self, connector) 200 smtp.SMTPFactory.startedConnecting(self, connector)
201 201
202 def clientConnectionLost(self, connector, reason): 202 def clientConnectionLost(self, connector, reason):
203 log.debug(_("SMTP server connection lost (reason: %s)"), reason) 203 log.debug(_(u"SMTP server connection lost (reason: %s)"), reason)
204 smtp.SMTPFactory.clientConnectionLost(self, connector, reason) 204 smtp.SMTPFactory.clientConnectionLost(self, connector, reason)
205 205
206 def buildProtocol(self, addr): 206 def buildProtocol(self, addr):
207 p = smtp.SMTPFactory.buildProtocol(self, addr) 207 p = smtp.SMTPFactory.buildProtocol(self, addr)
208 # add the challengers from imap4, more secure and complicated challengers are available 208 # add the challengers from imap4, more secure and complicated challengers are available