diff roundup-mailgw @ 491:ade1e4bfefc9

[SF#500329] exception on server not reachable-patch
author Richard Jones <richard@users.sourceforge.net>
date Mon, 07 Jan 2002 10:43:48 +0000
parents fad315a10185
children 1ebd38ababc9
line wrap: on
line diff
--- a/roundup-mailgw	Mon Jan 07 10:42:23 2002 +0000
+++ b/roundup-mailgw	Mon Jan 07 10:43:48 2002 +0000
@@ -16,7 +16,7 @@
 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
 # 
-# $Id: roundup-mailgw,v 1.19 2002-01-05 02:19:03 richard Exp $
+# $Id: roundup-mailgw,v 1.20 2002-01-07 10:43:48 richard Exp $
 
 # python version check
 from roundup import version_check
@@ -63,14 +63,18 @@
 def do_pop(handler, server, user='', password=''):
     '''Read a series of messages from the specified POP server.
     '''
-    import getpass, poplib
+    import getpass, poplib, socket
     if not user:
         user = raw_input(_('User: '))
     if not password:
         password = getpass.getpass()
 
     # open a connection to the server and retrieve all messages
-    server = poplib.POP3(server)
+    try:
+        server = poplib.POP3(server)
+    except socket.error, message:
+        print "POP server error:", message
+        return 1
     server.user(user)
     server.pass_(password)
     numMessages = len(server.list()[1])
@@ -169,6 +173,9 @@
 
 #
 # $Log: not supported by cvs2svn $
+# Revision 1.19  2002/01/05 02:19:03  richard
+# i18n'ification
+#
 # Revision 1.18  2001/12/13 00:20:01  richard
 #  . Centralised the python version check code, bumped version to 2.1.1 (really
 #    needs to be 2.1.2, but that isn't released yet :)

Roundup Issue Tracker: http://roundup-tracker.org/