git-multimail: update to release 1.1.1

The only change is a bugfix: the SMTP mailer was not working with
Python 2.4.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Matthieu Moy
2015-07-05 13:10:17 +02:00
committed by Junio C Hamano
parent cbed29f37b
commit 5bdb7a78ad
4 changed files with 17 additions and 6 deletions

View File

@@ -1745,14 +1745,20 @@ class SMTPMailer(Mailer):
self.username = smtpuser
self.password = smtppass
try:
def call(klass, server, timeout):
try:
return klass(server, timeout=timeout)
except TypeError:
# Old Python versions do not have timeout= argument.
return klass(server)
if self.security == 'none':
self.smtp = smtplib.SMTP(self.smtpserver, timeout=self.smtpservertimeout)
self.smtp = call(smtplib.SMTP, self.smtpserver, timeout=self.smtpservertimeout)
elif self.security == 'ssl':
self.smtp = smtplib.SMTP_SSL(self.smtpserver, timeout=self.smtpservertimeout)
self.smtp = call(smtplib.SMTP_SSL, self.smtpserver, timeout=self.smtpservertimeout)
elif self.security == 'tls':
if ':' not in self.smtpserver:
self.smtpserver += ':587' # default port for TLS
self.smtp = smtplib.SMTP(self.smtpserver, timeout=self.smtpservertimeout)
self.smtp = call(smtplib.SMTP, self.smtpserver, timeout=self.smtpservertimeout)
self.smtp.ehlo()
self.smtp.starttls()
self.smtp.ehlo()