[PATCH] localhost as the default smtp server

Aurelien Jacobs aurel at gnuage.org
Sun May 14 18:24:12 CDT 2006


Hi,

I've just spent some time trying to configure the mail notify extension.
It's now working, but it took me some time to discover that the default
smtp server is _not_ localhost, and how to configure the smtp server.

I think it would be less confusing to set localhost as the default
smtp server. That's the purpose of the attached patch.

And for those who wonder how to setup your smtp server, you can add those
lines in your hgrc:
[smtp]
host = localhost
port = 25

Aurel
-------------- next part --------------
diff -r ba7afc7dd901 mercurial/ui.py
--- a/mercurial/ui.py	Wed May 10 16:55:55 2006 -0500
+++ b/mercurial/ui.py	Mon May 15 01:17:58 2006 +0200
@@ -268,7 +268,7 @@ class ui(object):
 
     def sendmail(self):
         s = smtplib.SMTP()
-        s.connect(host = self.config('smtp', 'host', 'mail'),
+        s.connect(host = self.config('smtp', 'host', 'localhost'),
                   port = int(self.config('smtp', 'port', 25)))
         if self.configbool('smtp', 'tls'):
             s.ehlo()


More information about the Mercurial mailing list