[mirrorbrain-commits] r7838 - /trunk/mirrorprobe/mirrorprobe.py

From: <poeml_at_mirrorbrain.org>
Date: Thu, 08 Oct 2009 11:37:22 -0000
Author: poeml
Date: Thu Oct  8 13:37:22 2009
New Revision: 7838

URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=7838&view=rev
Log:
mirrorprobe: 
- when configuring the mail log handler, don't crash when the sender domain name isn't resolvable

Modified:
    trunk/mirrorprobe/mirrorprobe.py

Modified: trunk/mirrorprobe/mirrorprobe.py
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/mirrorprobe/mirrorprobe.py?rev=7838&r1=7837&r2=7838&view=diff
==============================================================================
--- trunk/mirrorprobe/mirrorprobe.py (original)
+++ trunk/mirrorprobe/mirrorprobe.py Thu Oct  8 13:37:22 2009
@@ -211,9 +211,13 @@
     #logging.getLogger('').addHandler(console)
 
     # warnings will be mailed
+    try:
+        fromdomain = socket.gethostbyaddr(socket.gethostname())[0] 
+    except:
+        fromdomain = ''
     toaddrs = [ i.strip() for i in options.mailto.split(',') ]
     mail = logging.handlers.SMTPHandler('localhost', 
-                                        'root@' + socket.gethostbyaddr(socket.gethostname())[0], 
+                                        'root@' + fromdomain,
                                         toaddrs,
                                         'no_subject')
     mail.setLevel(logging.WARNING)




_______________________________________________
mirrorbrain-commits mailing list
Archive: http://mirrorbrain.org/archive/mirrorbrain-commits/

Note: To remove yourself from this list, send a mail with the content
 	unsubscribe
to the address mirrorbrain-commits-request_at_mirrorbrain.org
Received on Thu Oct 08 2009 - 11:37:23 GMT

This archive was generated by hypermail 2.2.0 : Thu Oct 08 2009 - 11:45:08 GMT