package org.ibex.mail;
+import org.ibex.crypto.*;
// FIXME MIME: RFC2045, 2046, 2049
// NOTE: always use Win32 line endings
// hard line limit: 998 chars
// FEATURE: mailing list header parsing
// FEATURE: delivery status notification (and the sneaky variety)
// FEATURE: threading as in http://www.jwz.org/doc/threading.html
-public class Message {
+
+public class Message extends JSReflection {
public final String allHeaders; // pristine headers
public final Hashtable headers; // hash of headers (not including resent's and traces)
public boolean deleted = false;
public boolean read = false;
public boolean answered = false;
+ public String dumpStoredForm() { throw new Error("StoredMessage.dumpStoredForm() not implemented"); };
}
- public static class Address {
+ public static class Address extends JSReflection {
+ public String coerceToString() {
+ if (description == null || description.equals("")) return user +"@"+ host;
+ return description + " " + "<" + user +"@"+ host + ">";
+ }
public final String user;
public final String host;
public final String description;
}
}
- public static class Base36 {
- public static String encode(long l) {
- StringBuffer ret = new StringBuffer();
- while (l > 0) {
- if ((l % 36) < 10) ret.append((char)(((int)'0') + (int)(l % 36)));
- else ret.append((char)(((int)'A') + (int)((l % 36) - 10)));
- l /= 36;
- }
- }
- }
-
- public Message(ReadStream rs) {
+ // FIXME: support dotTerminatedLikeSMTP
+ public Message(ReadStream rs, boolean dotTermiantedLikeSMTP) {
String key = null;
StringBuffer all = new StringBuffer();
for(String s = rs.readLine(); s != null && !s.equals(""); s = rs.readLine()) {
return ret.toString();
}
- private static final Random = new Random();
+ private static final Random random = new Random();
}