comparison mercurial/ui.py @ 2583:6e5427447f4c

adding local_hostname option to smtp configuration
author Valentino Volonghi aka dialtone <dialtone@divmod.com>
date Sun, 09 Jul 2006 14:12:19 +0200
parents 18cf95ad3666
children 1f4703115e28
comparison
equal deleted inserted replaced
2576:6a961a54f953 2583:6e5427447f4c
296 call as sendmail(sender, list-of-recipients, msg).''' 296 call as sendmail(sender, list-of-recipients, msg).'''
297 297
298 def smtp(): 298 def smtp():
299 '''send mail using smtp.''' 299 '''send mail using smtp.'''
300 300
301 s = smtplib.SMTP() 301 local_hostname = self.config('smtp', 'local_hostname')
302 s = smtplib.SMTP(local_hostname=local_hostname)
302 mailhost = self.config('smtp', 'host') 303 mailhost = self.config('smtp', 'host')
303 if not mailhost: 304 if not mailhost:
304 raise util.Abort(_('no [smtp]host in hgrc - cannot send mail')) 305 raise util.Abort(_('no [smtp]host in hgrc - cannot send mail'))
305 mailport = int(self.config('smtp', 'port', 25)) 306 mailport = int(self.config('smtp', 'port', 25))
306 self.note(_('sending mail: smtp host %s, port %s\n') % 307 self.note(_('sending mail: smtp host %s, port %s\n') %