summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--rfc2045/reformime.c50
-rw-r--r--rfc2045/rfc2045.c16
-rw-r--r--rfc2045/rfc2045.h2
-rw-r--r--sqwebmail/autoresponse.c2
-rw-r--r--sqwebmail/configure.ac2
-rw-r--r--sqwebmail/html/en-us/expired.html5
-rw-r--r--sqwebmail/newmsg_newdraft.c3
7 files changed, 54 insertions, 26 deletions
diff --git a/rfc2045/reformime.c b/rfc2045/reformime.c
index a47eabf..e293bc5 100644
--- a/rfc2045/reformime.c
+++ b/rfc2045/reformime.c
@@ -856,33 +856,54 @@ char **l;
l[pcnt++]=last->fn;
mimedigest1(pcnt, l);
+ free(l);
+ while(first)
+ {
+ last=first->next;
+ free(first->fn);
+ free(first);
+ first=last;
+ }
}
static void mimedigest1(int argc, char **argv)
{
-time_t t;
-char boundarybuf[200];
-unsigned boundarycnt=0;
-int i;
-FILE *fp;
+ time_t t;
+ char boundarybuf[200];
+ unsigned boundarycnt=0;
+ int i;
+ FILE *fp;
+ int *utf8;
+ if (argc == 0)
+ return;
time (&t);
+ utf8=malloc(sizeof(int)*argc);
+
/* Search for a suitable boundary */
do
{
int l;
- sprintf(boundarybuf, "reformime_%lu_%u",
- (unsigned long)t, ++boundarycnt);
+ sprintf(boundarybuf, "reformime_%lu_%lu_%u",
+ (unsigned long)t,
+ (unsigned long)getpid(),
+ ++boundarycnt);
l=strlen(boundarybuf);
for (i=0; i<argc; i++)
{
- int err=0;
+ int err=0;
+ struct rfc2045 *parser=rfc2045_alloc();
+ if (!parser)
+ {
+ perror(argv[i]);
+ exit(1);
+ }
if ((fp=fopen(argv[i], "r")) == 0)
{
perror(argv[i]);
@@ -891,6 +912,8 @@ FILE *fp;
while (fgets(mimebuf, sizeof(mimebuf), fp))
{
+ rfc2045_parse(parser, mimebuf, strlen(mimebuf));
+
if (mimebuf[0] != '-' || mimebuf[1] != '-')
continue;
@@ -901,6 +924,9 @@ FILE *fp;
}
}
fclose(fp);
+ utf8[i]=parser->rfcviolation & RFC2045_ERR8BITHEADER
+ ? 1:0;
+ rfc2045_free(parser);
if (err) break;
}
} while (i < argc);
@@ -917,14 +943,16 @@ FILE *fp;
exit(1);
}
- printf("\n--%s\nContent-Type: message/rfc822\n\n",
- boundarybuf);
+ printf("\n--%s\nContent-Type: %s\n\n",
+ boundarybuf,
+ utf8[i] ? RFC2045_MIME_MESSAGE_GLOBAL:
+ RFC2045_MIME_MESSAGE_RFC822);
while (fgets(mimebuf, sizeof(mimebuf), fp))
printf("%s", mimebuf);
fclose(fp);
}
-
+ free(utf8);
printf("\n--%s--\n", boundarybuf);
}
diff --git a/rfc2045/rfc2045.c b/rfc2045/rfc2045.c
index 4e62e39..337ea34 100644
--- a/rfc2045/rfc2045.c
+++ b/rfc2045/rfc2045.c
@@ -743,8 +743,8 @@ char *p;
int rfc2045_message_content_type(const char *content_type)
{
- return strcmp(content_type, RFC2045_MIME_MESSAGE_RFC822) == 0 ||
- strcmp(content_type, RFC2045_MIME_MESSAGE_GLOBAL) == 0;
+ return strcasecmp(content_type, RFC2045_MIME_MESSAGE_RFC822) == 0 ||
+ strcasecmp(content_type, RFC2045_MIME_MESSAGE_GLOBAL) == 0;
}
/*
@@ -753,18 +753,18 @@ int rfc2045_message_content_type(const char *content_type)
int rfc2045_delivery_status_content_type(const char *content_type)
{
- return strcmp(content_type,
+ return strcasecmp(content_type,
RFC2045_MIME_MESSAGE_DELIVERY_STATUS) == 0 ||
- strcmp(content_type,
+ strcasecmp(content_type,
RFC2045_MIME_MESSAGE_GLOBAL_DELIVERY_STATUS) == 0;
}
int rfc2045_message_headers_content_type(const char *content_type)
{
- return strcmp(content_type,
- RFC2045_MIME_MESSAGE_HEADERS) == 0 ||
- strcmp(content_type,
- RFC2045_MIME_MESSAGE_GLOBAL_HEADERS) == 0;
+ return strcasecmp(content_type,
+ RFC2045_MIME_MESSAGE_HEADERS) == 0 ||
+ strcasecmp(content_type,
+ RFC2045_MIME_MESSAGE_GLOBAL_HEADERS) == 0;
}
/* Various permutations of the above, including forcing the string to
diff --git a/rfc2045/rfc2045.h b/rfc2045/rfc2045.h
index 4abdf2c..4aec67b 100644
--- a/rfc2045/rfc2045.h
+++ b/rfc2045/rfc2045.h
@@ -29,7 +29,7 @@ extern "C" {
#define RFC2045_MIME_MESSAGE_GLOBAL_DELIVERY_STATUS \
"message/global-delivery-status"
-#define RFC2045_MIME_MESSAGE_HEADERS "message/rfc822-headers"
+#define RFC2045_MIME_MESSAGE_HEADERS "text/rfc822-headers"
#define RFC2045_MIME_MESSAGE_GLOBAL_HEADERS "message/global-headers"
int rfc2045_message_content_type(const char *);
diff --git a/sqwebmail/autoresponse.c b/sqwebmail/autoresponse.c
index 2ed3f06..b1dccbf 100644
--- a/sqwebmail/autoresponse.c
+++ b/sqwebmail/autoresponse.c
@@ -386,7 +386,7 @@ static void end_upload(void *vp)
mimetype=calc_mime_type(uai->filename);
- if (strcasecmp(mimetype, "message/rfc822") == 0)
+ if (rfc2045_message_content_type(mimetype))
{
/* Magic */
diff --git a/sqwebmail/configure.ac b/sqwebmail/configure.ac
index 615c692..7c3e080 100644
--- a/sqwebmail/configure.ac
+++ b/sqwebmail/configure.ac
@@ -2,7 +2,7 @@ dnl
dnl Copyright 1998 - 2017 Double Precision, Inc. See COPYING for
dnl distribution information.
-AC_INIT(sqwebmail, 5.9.2, [courier-sqwebmail@lists.sourceforge.net])
+AC_INIT(sqwebmail, 5.9.3, [courier-sqwebmail@lists.sourceforge.net])
>confdefs.h # Kill PACKAGE_ macros
diff --git a/sqwebmail/html/en-us/expired.html b/sqwebmail/html/en-us/expired.html
index 6278db8..3e26010 100644
--- a/sqwebmail/html/en-us/expired.html
+++ b/sqwebmail/html/en-us/expired.html
@@ -30,9 +30,8 @@ document.logon.username.focus();
<tbody>
<tr>
<td align="left"><p class="error">Your request cannot be authenticated.
- Either your session has timed out, or your IP address has changed. If
- you are dialing in via a modem, this can happen if you get
- disconnected. After reconnecting, you must log in again.</p>
+ Either your session has timed out, or your IP address has changed.
+ You need to log in again.</p>
</td>
</tr>
</tbody>
diff --git a/sqwebmail/newmsg_newdraft.c b/sqwebmail/newmsg_newdraft.c
index 6eb4a9b..8158d40 100644
--- a/sqwebmail/newmsg_newdraft.c
+++ b/sqwebmail/newmsg_newdraft.c
@@ -105,7 +105,8 @@ int x;
rfc2045_mimeinfo(rfc2045partp, &content_type,
&dummy, &dummy);
- if (!content_type || strcmp(content_type, "message/rfc822"))
+ if (!content_type ||
+ !rfc2045_message_content_type(content_type))
rfc2045partp=0;
else
rfc2045partp=rfc2045partp->firstpart;