Mercurial > public > mercurial-scm > hg
comparison mercurial/mail.py @ 12090:ee601a6264e0 stable
mail: use standard section.entry format in error message
author | Martin Geisler <mg@lazybytes.net> |
---|---|
date | Mon, 30 Aug 2010 22:47:38 +0200 |
parents | 594b98846ce1 |
children | 339bd18c772f |
comparison
equal
deleted
inserted
replaced
12083:ebfc46929f3e | 12090:ee601a6264e0 |
---|---|
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 = int(ui.config('smtp', 'port', 25)) | 40 mailport = int(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'): |