} else { break;
	public MessageParser(BufferedReader in, PrintWriter out, String file)							throws IOException,							MessageParseException {		file = file.substring(0, file.length() - 5);		MessageHeaderParser mhp = new MessageHeaderParser();		mhp.parse(in);		out.println("<html>");		out.println("<body>");		out.println("<table>");		if (mhp.getHeaderField("Date") != null) {			DateParser dp = new DateParser();			dp.setTargetFormat(YAMM.getString("longdate"));			String date = null;			try {				date = dp.parse(mhp.getHeaderField("Date"));			} catch (ParseException pe) {				date = "";			}			out.println("<tr><td>" + YAMM.getString("mail.date") +				"</td><td>" + date + "</td></tr>");		}		if (mhp.getHeaderField("From") != null) {			String from = makeClickable(mhp.getHeaderField("From"));			out.println("<tr><td>" + YAMM.getString("mail.from") +				"</td><td>" + from + "</td></tr>");		}		if (mhp.getHeaderField("To") != null) {			String to = makeClickable(mhp.getHeaderField("To"));			out.println("<tr><td>" + YAMM.getString("mail.to") +				"</td><td>" + to + "</td></tr>");		}		if (mhp.getHeaderField("cc") != null) {			String cc = makeClickable(mhp.getHeaderField("cc"));			out.println("<tr><td>cc:</td><td>" + cc + "</td></tr>");		}		if (mhp.getHeaderField("Reply-To") != null) {			String replyto = makeClickable(						mhp.getHeaderField("Reply-To"));			out.println("<tr><td>" + 				YAMM.getString("mail.reply_to") + "</td><td>" +				replyto + "</td></tr>");		}		if (mhp.getHeaderField("Subject") != null) {			out.println("<tr><td>" + 				YAMM.getString("mail.subject") + "</td><td>" +				Mailbox.unMime(mhp.getHeaderField("Subject")) +				"</td></tr>");		}		out.println("</table>");		out.println("<br><pre>");		String boundary = null;		String temp = mhp.getHeaderField("Content-Type");		String contentType = "";		if (temp != null) {			contentType = temp.toLowerCase();			if (contentType.indexOf("boundary=") != -1) {				boundary = temp.substring(					contentType.indexOf("boundary=") + 9,					temp.length());				if (boundary.startsWith("\"")) {					boundary = boundary.substring(1, boundary.length() - 1);				}			}		}		if (mhp.getHeaderField("MIME-Version") != null) {			// expect a little mime message			for (;;) {				if (boundary != null) {					if (in.readLine().equals("--" +	boundary)) {						new Attachment().parse(in,						null);						break;					}				} else {					break;				}			}		}		MessageBodyParser mbp = new MessageBodyParser(true);		bigLoop:		for (;;) {			int test = mbp.parse(in, out, boundary);			if (test == MessageBodyParser.ATTACHMENT &&							contentType.indexOf("multipart/alternative") == -1) {				Attachment a = new Attachment();				PrintWriter atOut = null;				try {					atOut = new PrintWriter(						new BufferedOutputStream(						new FileOutputStream(file +							".attach." +							attachments)));									for (;;) {						// Attachment found						test = a.parse(in, atOut);						if (test == Attachment.MESSAGE &&								contentType.indexOf("multipart/alternative") == -1) {							break;						} else if (test == Attachment.ATTACHMENT) {							attachments++;							atOut.close();							atOut = new PrintWriter(new								BufferedOutputStream(								new FileOutputStream(									file +									".attach." +									attachments)));							continue;						} else /* if (test == Attachment.END) */{							break bigLoop;						}					}				} finally {					if (atOut != null) {						atOut.close();					}				}			} else if (test == MessageBodyParser.END) {				// end reached				break;			} else if (test == MessageBodyParser.ATTACHMENT) {				break;			}		}		out.println("</pre></body>");		out.println("</html>");	}