comparison mercurial/mail.py @ 12091:339bd18c772f

merge with stable
author Martin Geisler <mg@lazybytes.net>
date Mon, 30 Aug 2010 22:52:00 +0200
parents 49463314c24f ee601a6264e0
children f05250572467
comparison
equal deleted inserted replaced
12089:70f4a0f4e9a3 12091:339bd18c772f
34 '''build an smtp connection and return a function to send mail''' 34 '''build an smtp connection and return a function to send mail'''
35 local_hostname = ui.config('smtp', 'local_hostname') 35 local_hostname = ui.config('smtp', 'local_hostname')
36 s = smtplib.SMTP(local_hostname=local_hostname) 36 s = smtplib.SMTP(local_hostname=local_hostname)
37 mailhost = ui.config('smtp', 'host') 37 mailhost = ui.config('smtp', 'host')
38 if not mailhost: 38 if not mailhost:
39 raise util.Abort(_('no [smtp]host in hgrc - cannot send mail')) 39 raise util.Abort(_('smtp.host not configured - cannot send mail'))
40 mailport = util.getport(ui.config('smtp', 'port', 25)) 40 mailport = util.getport(ui.config('smtp', 'port', 25))
41 ui.note(_('sending mail: smtp host %s, port %s\n') % 41 ui.note(_('sending mail: smtp host %s, port %s\n') %
42 (mailhost, mailport)) 42 (mailhost, mailport))
43 s.connect(host=mailhost, port=mailport) 43 s.connect(host=mailhost, port=mailport)
44 if ui.configbool('smtp', 'tls'): 44 if ui.configbool('smtp', 'tls'):