diff -u -r1.20 -r1.23
--- courier-vanilla/webmail/html.c	6 Oct 2003 00:16:13 -0000	1.20
+++ courier/webmail/html.c	26 Aug 2005 23:00:58 -0000	1.23
@@ -187,9 +187,16 @@
 					if (tai)	++tai->tagvaluelen;
 				}
 				if (*p)	p++;
+				else
+				{
+					memset(tagbuf, ' ', strlen(tagbuf));
+				}
 			}
 			else
 			{
+				if (c == 0)
+					memset(tagbuf, ' ', strlen(tagbuf));
+
 				if (tai)
 				{
 					tai->tagvalue=p;
@@ -222,6 +229,31 @@
 	while ((p=strchr(tagbuf, '<')) != NULL)
 		*p=' ';
 
+	for (p=tagbuf; *p; p++)
+	{
+		char *q;
+
+		if (*p != '&')
+			continue;
+
+		q=p;
+
+		++p;
+
+		while (*p)
+		{
+			if (strchr("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789", *p) == NULL)
+				break;
+			++p;
+		}
+
+		if (*p != ';')
+		{
+			*q=0;
+		}
+		--p;
+	}
+
         tagattrlen=parseattr(0);
         if ( tagattrlen > tagattrsize)
         {
diff -u -r1.157 -r1.158
--- courier-vanilla/webmail/folder.c	25 Nov 2004 15:03:12 -0000	1.157
+++ courier/webmail/folder.c	24 Aug 2005 00:24:15 -0000	1.158
@@ -1,4 +1,4 @@
 /*
-** Copyright 1998 - 2004 Double Precision, Inc.  See COPYING for
+** Copyright 1998 - 2005 Double Precision, Inc.  See COPYING for
 ** distribution information.
 */
@@ -2238,13 +2238,19 @@
 	if (strcmp(cgi("form"), "print") == 0)
 	{
 		showattname(getarg("ATTSTUB"), dummy, content_type);
+
+		printf("&nbsp;(");
+		output_attrencoded(content_type);
+		printf(")");
 	}
 	else
 	{
 		printf("<div align=\"center\"><span class=\"message-attachment-header\">");
 		showattname(getarg("ATTACHMENT"), dummy, content_type);
 
-		printf("&nbsp;(%s)</span></div>",
+		printf("&nbsp;(");
+		output_attrencoded(content_type);
+		printf("; %s)</span></div>",
 		       showsize(end_pos - start_body));
 		printf("<br /><div align=\"center\">");
 
