From: richard Date: Mon, 7 Jan 2002 10:43:48 +0000 (+0000) Subject: #500329 ] exception on server not reachable-patch X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=d5de767a3f6b139e1e75527b40306bb129873f38;p=roundup.git #500329 ] exception on server not reachable-patch git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@503 57a73879-2fb5-44c3-a270-3262357dd7e2 --- diff --git a/roundup-mailgw b/roundup-mailgw index 00905c0..e6de399 100755 --- a/roundup-mailgw +++ b/roundup-mailgw @@ -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_mailbox(handler, filename): 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 @@ if __name__ == '__main__': # # $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 :)