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 _at_@ -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_at_' + socket.gethostbyaddr(socket.gethostname())[0], + 'root_at_' + 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.orgReceived on Thu Oct 08 2009 - 11:37:23 GMT
This archive was generated by hypermail 2.3.0 : Mon Feb 20 2012 - 23:47:04 GMT