[Pkg-wmaker-commits] [wmbiff] 05/09: fix debian #242458 -- allow IP addresses as server names for IMAP mailboxes, and also for POP3 mailboxes

Doug Torrance dtorrance-guest at moszumanska.debian.org
Thu Aug 20 03:05:27 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to tag wmbiff_0_4_23
in repository wmbiff.

commit bfc25b54a14f0877fce61f8dc6768e8e1fde13f3
Author: bluehal <bluehal>
Date:   Tue Apr 6 20:58:52 2004 +0000

    fix debian #242458 -- allow IP addresses as server names for IMAP mailboxes, and also for POP3 mailboxes
---
 wmbiff/Imap4Client.c |  4 ++--
 wmbiff/Pop3Client.c  |  6 +++---
 wmbiff/test_wmbiff.c | 10 +++++++++-
 3 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/wmbiff/Imap4Client.c b/wmbiff/Imap4Client.c
index a38ef4d..15b7ef3 100644
--- a/wmbiff/Imap4Client.c
+++ b/wmbiff/Imap4Client.c
@@ -479,8 +479,8 @@ int imap4Create( /*@notnull@ */ Pop3 pc, const char *const str)
 	/* special characters aren't allowed in hostnames, rfc 1034 */
 	const char *regexes[] = {
 		// type : username     :   password @ hostname (/ name)?(:port)?
-		".*imaps?:([^: ]{1,32}):([^@]{0,32})@([A-Za-z][-A-Za-z0-9_.]+)(/(\"[^\"]+\")|([^:@ ]+))?(:[0-9]+)?(  *([CcAaPp][-A-Za-z5 ]*))?$",
-		".*imaps?:([^: ]{1,32}) ([^ ]{1,32}) ([A-Za-z][-A-Za-z0-9_.]+)(/(\"[^\"]+\")|([^: ]+))?( [0-9]+)?(  *([CcAaPp][-A-Za-z5 ]*))?$",
+		".*imaps?:([^: ]{1,32}):([^@]{0,32})@([A-Za-z1-9][-A-Za-z0-9_.]+)(/(\"[^\"]+\")|([^:@ ]+))?(:[0-9]+)?(  *([CcAaPp][-A-Za-z5 ]*))?$",
+		".*imaps?:([^: ]{1,32}) ([^ ]{1,32}) ([A-Za-z1-9][-A-Za-z0-9_.]+)(/(\"[^\"]+\")|([^: ]+))?( [0-9]+)?(  *([CcAaPp][-A-Za-z5 ]*))?$",
 		NULL
 	};
 	char *unaliased_str;
diff --git a/wmbiff/Pop3Client.c b/wmbiff/Pop3Client.c
index 26d1de9..cce9af1 100644
--- a/wmbiff/Pop3Client.c
+++ b/wmbiff/Pop3Client.c
@@ -1,4 +1,4 @@
-/* $Id: Pop3Client.c,v 1.20 2004/03/28 00:28:58 bluehal Exp $ */
+/* $Id: Pop3Client.c,v 1.21 2004/04/06 20:58:53 bluehal Exp $ */
 /* Author : Scott Holden ( scotth at thezone.net )
    Modified : Yong-iL Joh ( tolkien at mizi.com )
    Modified : Jorge Garc�a ( Jorge.Garcia at uv.es )
@@ -193,8 +193,8 @@ int pop3Create(Pop3 pc, const char *str)
 	   use of '@' in passwords
 	 */
 	const char *regexes[] = {
-		"pop3:([^: ]{1,32}):([^@]{0,32})@([A-Za-z][-A-Za-z0-9_.]+)(:[0-9]+)?(  *([CcAaPp][-A-Za-z5 ]*))?$",
-		"pop3:([^: ]{1,32}) ([^ ]{1,32}) ([A-Za-z][-A-Za-z0-9_.]+)( [0-9]+)?(  *([CcAaPp][-A-Za-z5 ]*))?$",
+		"pop3:([^: ]{1,32}):([^@]{0,32})@([A-Za-z1-9][-A-Za-z0-9_.]+)(:[0-9]+)?(  *([CcAaPp][-A-Za-z5 ]*))?$",
+		"pop3:([^: ]{1,32}) ([^ ]{1,32}) ([A-Za-z1-9][-A-Za-z0-9_.]+)( [0-9]+)?(  *([CcAaPp][-A-Za-z5 ]*))?$",
 		//      "pop3:([^: ]{1,32}) ([^ ]{1,32}) ([^: ]+)( [0-9]+)? *",
 		// "pop3:([^: ]{1,32}):([^@]{0,32})@([^: ]+)(:[0-9]+)? *",
 		NULL
diff --git a/wmbiff/test_wmbiff.c b/wmbiff/test_wmbiff.c
index fe1d982..31f995d 100644
--- a/wmbiff/test_wmbiff.c
+++ b/wmbiff/test_wmbiff.c
@@ -57,7 +57,7 @@ int test_backtickExpand(void)
 }
 
 #define CKSTRING(x,shouldbe) if(strcmp(x,shouldbe)) { \
-printf("Failed: expected '" #shouldbe "' but got '%s'\n", x); \
+printf("FAILED: expected '" #shouldbe "' but got '%s'\n", x); \
  return 1; } else { printf("good: '" shouldbe "' == '%s'\n", x); }
 
 /* return 1 if fail, 0 if success */
@@ -188,6 +188,14 @@ int test_imap4creator(void)
 	CKSTRING(m.u.pop_imap.serverName, "bar");
 	CKINT(m.u.pop_imap.serverPort, 143);
 
+	if (imap4Create(&m, "imap:foo:@192.168.1.1/\"mybox\"")) {
+        printf("FAILED: to create IMAP box with IP address for servername\n");
+		return 1;
+	}
+	CKSTRING(m.path, "\"mybox\"");
+	CKSTRING(m.u.pop_imap.serverName, "192.168.1.1");
+	CKINT(m.u.pop_imap.serverPort, 143);
+
 	if (imap4Create(&m, "imap:foo:@bar/\"space box\"")) {
 		return 1;
 	}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmbiff.git



More information about the Pkg-wmaker-commits mailing list