Update of /cvsroot/mahogany/M/lib/imap/src/c-client
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7115/src/c-client
Modified Files:
mail.h pop3.c rfc822.c smtp.c
Log Message:
merged imap 2004 RC9
Index: mail.h
===================================================================
RCS file: /cvsroot/mahogany/M/lib/imap/src/c-client/mail.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -b -u -2 -r1.2 -r1.3
--- mail.h 24 Apr 2004 23:12:57 -0000 1.2
+++ mail.h 28 Apr 2004 22:45:54 -0000 1.3
@@ -11,5 +11,5 @@
*
* Date: 22 November 1989
- * Last Edited: 24 February 2004
+ * Last Edited: 22 March 2004
*
* The IMAP toolkit provided in this Distribution is
@@ -395,4 +395,6 @@
/* no fetch lookahead */
#define FT_NOLOOKAHEAD (long) 0x200
+ /* lookahead in header searching */
+#define FT_SEARCHLOOKAHEAD (long) 0x400
@@ -1136,4 +1138,5 @@
unsigned int sensitive : 1; /* sensitive data in progress */
unsigned int loser : 1; /* server is a loser */
+ unsigned int saslcancel : 1; /* SASL cancelled by protocol */
union { /* protocol specific */
struct { /* SMTP specific */
@@ -1570,8 +1573,9 @@
void mail_gc_body (BODY *body);
-BODY *mail_body (MAILSTREAM *stream,unsigned long msgno,char *section);
+BODY *mail_body (MAILSTREAM *stream,unsigned long msgno,
+ unsigned char *section);
char *mail_date (char *string,MESSAGECACHE *elt);
char *mail_cdate (char *string,MESSAGECACHE *elt);
-long mail_parse_date (MESSAGECACHE *elt,char *string);
+long mail_parse_date (MESSAGECACHE *elt,unsigned char *string);
void mail_exists (MAILSTREAM *stream,unsigned long nmsgs);
void mail_recent (MAILSTREAM *stream,unsigned long recent);
@@ -1636,6 +1640,6 @@
THREADNODE *mail_thread_sort (THREADNODE *thr,THREADNODE **tc);
int mail_thread_compare_date (const void *a1,const void *a2);
-long mail_sequence (MAILSTREAM *stream,char *sequence);
-long mail_uid_sequence (MAILSTREAM *stream,char *sequence);
+long mail_sequence (MAILSTREAM *stream,unsigned char *sequence);
+long mail_uid_sequence (MAILSTREAM *stream,unsigned char *sequence);
long mail_parse_flags (MAILSTREAM *stream,char *flag,unsigned long *uf);
long mail_usable_network_stream (MAILSTREAM *stream,char *name);
Index: pop3.c
===================================================================
RCS file: /cvsroot/mahogany/M/lib/imap/src/c-client/pop3.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -b -u -2 -r1.2 -r1.3
--- pop3.c 24 Apr 2004 23:12:57 -0000 1.2
+++ pop3.c 28 Apr 2004 22:45:54 -0000 1.3
@@ -11,8 +11,8 @@
*
* Date: 6 June 1994
- * Last Edited: 15 October 2003
+ * Last Edited: 15 March 2004
*
* The IMAP toolkit provided in this Distribution is
- * Copyright 1988-2003 University of Washington.
+ * Copyright 1988-2004 University of Washington.
* The full text of our legal notices is contained in the file called
* CPYRIGHT, included with this Distribution.
@@ -63,4 +63,5 @@
unsigned int sensitive : 1; /* sensitive data in progress */
unsigned int loser : 1; /* server is a loser */
+ unsigned int saslcancel : 1; /* SASL cancelled by protocol */
} POP3LOCAL;
@@ -600,5 +601,5 @@
mb->host[NETMAXHOST-1] = '\0';
}
- for (t = NIL; !ret && LOCAL->netstream && auths &&
+ for (t = NIL, LOCAL->saslcancel = NIL; !ret && LOCAL->netstream && auths &&
(at = mail_lookup_auth (find_rightmost_bit (&auths)+1)); ) {
if (t) { /* previous authenticator failed? */
@@ -615,4 +616,5 @@
fs_give ((void **) &t);
}
+ LOCAL->saslcancel = NIL;
if (pop3_send (stream,"AUTH",at->name)) {
/* hide client authentication responses */
@@ -632,6 +634,8 @@
}
if (t) { /* previous authenticator failed? */
+ if (!LOCAL->saslcancel) { /* don't do this if a cancel */
sprintf (pwd,"Can not authenticate to POP3 server: %.80s",t);
mm_log (pwd,ERROR);
+ }
fs_give ((void **) &t);
}
@@ -718,6 +722,8 @@
else ret = net_sout (LOCAL->netstream,"\015\012",2);
}
- /* abort requested */
- else ret = net_sout (LOCAL->netstream,"*\015\012",3);
+ else { /* abort requested */
+ ret = net_sout (LOCAL->netstream,"*\015\012",3);
+ LOCAL->saslcancel = T; /* mark protocol-requested SASL cancel */
+ }
pop3_reply (stream); /* get response */
return ret;
Index: rfc822.c
===================================================================
RCS file: /cvsroot/mahogany/M/lib/imap/src/c-client/rfc822.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -b -u -2 -r1.2 -r1.3
--- rfc822.c 24 Apr 2004 23:12:57 -0000 1.2
+++ rfc822.c 28 Apr 2004 22:45:54 -0000 1.3
@@ -11,5 +11,5 @@
*
* Date: 27 July 1988
- * Last Edited: 17 February 2004
+ * Last Edited: 8 March 2004
*
* The IMAP toolkit provided in this Distribution is
@@ -1725,4 +1725,5 @@
#define JNK 0177
+#define IGN 0176
#define PAD 0100
@@ -1734,5 +1735,5 @@
int e;
static char decode[256] = {
- JNK,JNK,JNK,JNK,JNK,JNK,JNK,JNK,JNK,JNK,JNK,JNK,JNK,JNK,JNK,JNK,
+ JNK,JNK,JNK,JNK,JNK,JNK,JNK,JNK,JNK,JNK,IGN,JNK,JNK,IGN,JNK,JNK,
JNK,JNK,JNK,JNK,JNK,JNK,JNK,JNK,JNK,JNK,JNK,JNK,JNK,JNK,JNK,JNK,
JNK,JNK,JNK,JNK,JNK,JNK,JNK,JNK,JNK,JNK,JNK,076,JNK,JNK,JNK,077,
@@ -1775,6 +1776,9 @@
}
break;
- case JNK: /* junk character */
+ case IGN: /* character to ignore */
break;
+ case JNK: /* junk character */
+ fs_give (&ret);
+ return NIL;
case PAD: /* padding */
switch (e++) { /* check quantum position */
@@ -1870,4 +1874,6 @@
unsigned long *len)
{
+ char tmp[MAILTMPLEN];
+ unsigned int bogon = NIL;
unsigned char *ret = (unsigned char *) fs_get ((size_t) srcl + 1);
unsigned char *d = ret;
@@ -1892,6 +1898,21 @@
if (!(isxdigit (c) && (((unsigned long) (s - src)) < srcl) &&
(e = *s++) && isxdigit (e))) {
- fs_give ((void **) &ret);
- return NIL;
+ /* This indicates bad MIME. One way that it can be caused is if
+ a single-section message was QUOTED-PRINTABLE encoded and then
+ something (e.g. a mailing list processor) appended text. The
+ problem is that there is no way to determine where the encoded
+ data ended and the appended crud began. Consequently, prudent
+ software will always encapsulate a QUOTED-PRINTABLE segment
+ inside a MULTIPART.
+ */
+ if (!bogon++) { /* only do this once */
+ sprintf (tmp,"Invalid quoted-printable sequence: =%.80s",
+ (char *) s - 1);
+ mm_log (tmp,PARSE);
+ }
+ *d++ = '='; /* treat = as ordinary character */
+ *d++ = c; /* and the character following */
+ t = d; /* note point of non-space */
+ break;
}
if (isdigit (c)) c -= '0';
Index: smtp.c
===================================================================
RCS file: /cvsroot/mahogany/M/lib/imap/src/c-client/smtp.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -b -u -2 -r1.2 -r1.3
--- smtp.c 24 Apr 2004 23:12:57 -0000 1.2
+++ smtp.c 28 Apr 2004 22:45:54 -0000 1.3
@@ -11,8 +11,8 @@
*
* Date: 27 July 1988
- * Last Edited: 15 October 2003
+ * Last Edited: 15 March 2004
*
* The IMAP toolkit provided in this Distribution is
- * Copyright 1988-2003 University of Washington.
+ * Copyright 1988-2004 University of Washington.
* The full text of our legal notices is contained in the file called
* CPYRIGHT, included with this Distribution.
@@ -291,5 +291,6 @@
AUTHENTICATOR *at;
long ret = NIL;
- for (auths = ESMTP.auth; !ret && stream->netstream && auths &&
+ for (auths = ESMTP.auth, stream->saslcancel = NIL;
+ !ret && stream->netstream && auths &&
(at = mail_lookup_auth (find_rightmost_bit (&auths) + 1)); ) {
if (lsterr) { /* previous authenticator failed? */
@@ -307,4 +308,5 @@
fs_give ((void **) &lsterr);
}
+ stream->saslcancel = NIL;
if (smtp_send (stream,"AUTH",at->name)) {
/* hide client authentication responses */
@@ -324,6 +326,8 @@
}
if (lsterr) { /* previous authenticator failed? */
+ if (!stream->saslcancel) { /* don't do this if a cancel */
sprintf (tmp,"Can not authenticate to SMTP server: %.80s",lsterr);
mm_log (tmp,ERROR);
+ }
fs_give ((void **) &lsterr);
}
@@ -374,6 +378,8 @@
else i = smtp_send (stream,"",NIL);
}
- /* abort requested */
- else i = smtp_send (stream,"*",NIL);
+ else { /* abort requested */
+ i = smtp_send (stream,"*",NIL);
+ stream->saslcancel = T; /* mark protocol-requested SASL cancel */
+ }
return LONGT;
}
-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g.
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates