Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/mail.py @ 4489:a11e13d50645
patchbomb: Validate email config before we start prompting for info.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Sun, 27 May 2007 14:40:14 -0700 |
parents | 49237d6ae97d |
children | 23889160905a |
comparison
equal
deleted
inserted
replaced
4488:62019c4427e3 | 4489:a11e13d50645 |
---|---|
66 | 66 |
67 return _sendmail(ui, method) | 67 return _sendmail(ui, method) |
68 | 68 |
69 def sendmail(ui, sender, recipients, msg): | 69 def sendmail(ui, sender, recipients, msg): |
70 return connect(ui).sendmail(sender, recipients, msg) | 70 return connect(ui).sendmail(sender, recipients, msg) |
71 | |
72 def validateconfig(ui): | |
73 '''determine if we have enough config data to try sending email.''' | |
74 method = ui.config('email', 'method', 'smtp') | |
75 if method == 'smtp': | |
76 if not ui.config('smtp', 'host'): | |
77 raise util.Abort(_('smtp specified as email transport, ' | |
78 'but no smtp host configured')) | |
79 else: | |
80 if not util.find_exe(method): | |
81 raise util.Abort(_('%r specified as email transport, ' | |
82 'but not in PATH') % method) |