SusiMail: Fix case where getHeaderLineAttribute() was fooled

Time format tweak in message view
Debug tweak
This commit is contained in:
zzz
2018-02-08 15:58:15 +00:00
parent 8161f099d2
commit 3d25a9fd66
3 changed files with 28 additions and 3 deletions

View File

@@ -335,7 +335,7 @@ class Mail {
private static final DateFormat dateFormatter = new SimpleDateFormat("yyyy-MM-dd HH:mm");
private static final DateFormat localDateFormatter = DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT);
private static final DateFormat longLocalDateFormatter = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM);
private static final DateFormat longLocalDateFormatter = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.SHORT);
static {
// the router sets the JVM time zone to UTC but saves the original here so we can get it
TimeZone tz = SystemVersion.getSystemTimeZone();

View File

@@ -361,7 +361,7 @@ class MailPart {
String result = null;
int h = 0;
int l = attributeName.length();
while( true ) {
while (result == null) {
int i = lineLC.indexOf(attributeName, h);
// System.err.println( "i=" + i );
if( i == -1 )
@@ -466,4 +466,29 @@ class MailPart {
);
return buf.toString();
}
/****
public static void main(String[] args) {
String test = "Content-Type: multipart/alternative; boundary=\"__________MIMEboundary__________\"; charset=\"UTF-8\"";
System.out.println(test);
String hlc = test.toLowerCase(Locale.US);
if (hlc.startsWith( "content-type: ")) {
System.out.println("find first attribute");
String x_type = getFirstAttribute(test).toLowerCase(Locale.US);
String x_charset = null;
String boundary = null;
System.out.println("find boundary");
String str = getHeaderLineAttribute(test, "boundary");
if( str != null )
boundary = str;
System.out.println("find charset");
str = getHeaderLineAttribute(test, "charset");
if( str != null )
x_charset = str.toUpperCase(Locale.US);
System.out.println("Type: " + x_type +
"\nBoundary: " + boundary +
"\nCharset: " + x_charset);
}
}
****/
}

View File

@@ -641,7 +641,7 @@ public class WebMail extends HttpServlet
if (chosen.equals(subPart))
continue;
out.println( "<!-- " );
out.println( "Debug: Not showing alternative Mail Part at level " + (level + 1) + " with hash code " + mailPart.hashCode());
out.println( "Debug: Not showing alternative Mail Part at level " + (level + 1) + " with hash code " + subPart.hashCode());
out.println( "Debug: Mail Part headers follow");
for( int i = 0; i < subPart.headerLines.length; i++ ) {
out.println( subPart.headerLines[i].replace("--", "&#45;&#45;") );