From ee1b3a5824dd0a41d45befaeb5889a79c2a0edbc Mon Sep 17 00:00:00 2001 From: Rene Ladan Date: Sun, 29 Apr 2012 19:14:22 +0000 Subject: - Fix fetching mail via IMAP from Gmail and other providers. - Bump PORTREVISION PR: ports/154254 Submitted by: G. Paul Ziemba [p-fbsd-bugs ziemba!us] --- mail/asmail/files/patch-globals.h | 14 ++++++++++++++ mail/asmail/files/patch-imap.c | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 mail/asmail/files/patch-globals.h create mode 100644 mail/asmail/files/patch-imap.c (limited to 'mail/asmail/files') diff --git a/mail/asmail/files/patch-globals.h b/mail/asmail/files/patch-globals.h new file mode 100644 index 000000000000..da5be836b047 --- /dev/null +++ b/mail/asmail/files/patch-globals.h @@ -0,0 +1,14 @@ +--- globals.h.orig 2007-04-09 00:51:09.000000000 -0700 ++++ globals.h 2011-01-06 22:55:10.000000000 -0800 +@@ -15,7 +15,9 @@ + #define VERSION "2.1" + #define RCFILE ".asmailrc" + /* Watch out! The MAX_INPUT_LENGTH must be a multiple of 64! */ +-#define MAX_INPUT_LENGTH 255 ++/* Why?? 255 (the original value) is not a multiple of 64. 255 is too small */ ++/* for IMAP responses */ ++#define MAX_INPUT_LENGTH 4096 + + #define pthread_attr_default NULL + +--- patch-globals.h ends here --- \ No newline at end of file diff --git a/mail/asmail/files/patch-imap.c b/mail/asmail/files/patch-imap.c new file mode 100644 index 000000000000..1afae09b06d4 --- /dev/null +++ b/mail/asmail/files/patch-imap.c @@ -0,0 +1,32 @@ +--- imap.c.orig 2007-02-27 10:19:38.000000000 -0800 ++++ imap.c 2011-01-06 23:12:58.000000000 -0800 +@@ -138,13 +138,18 @@ + + /* connection is open, let's log in */ + +- sprintf(output, "A000 LOGIN %s %s\r\n", mb->user, mb->pass); +- WRITE_OUTPUT; ++ sprintf(output, "A000 LOGIN %s %s\r\n", mb->user, mb->pass); ++ WRITE_OUTPUT; ++ while (1) { + WAITOK; ++ if (strncmp(input, "A000 ", 5)) /* allow for other tags/untagged */ ++ continue; ++ + if ( strncmp(input, "A000 OK", 7) ) { +- BYE(STAT_LOGIN); ++ BYE(STAT_LOGIN); + } + return(STAT_IDLE); ++ } + } + + +@@ -287,6 +292,7 @@ + imap_checkmbox(mb, &s); + } + } else { ++ mb->status = STAT_RUN; + mb->status |= imap_login(mb, &s); + mb->status |= imap_checkmbox(mb, &s); + mb->status |= imap_goodbye(mb, &s); \ No newline at end of file -- cgit v1.2.3