-import org.prevayler.*;
-import org.prevayler.Query;
-
-// FEATURE: umbrella structure to mailing lists
-public class MailingList extends Target implements Serializable {
-
- public static enum UserType { Administrator, Moderator, Member }
- public static enum SubscriptionType { All, None, Digest, MimeDigest }
- public static enum Visibility { Members, Public, Nobody }
- public static enum Action { Accept, Hold, Reject }
-
- public Address address;
- public Mailbox archive;
- private final long secret;
- private MailingList(Address a, Mailbox ar, long s) { this.address=a; this.archive=ar; this.secret=s; }
-
- public Hashtable subscribers = new Hashtable();
- public Filter[] filters = new Filter[0];
-
- public String homepage = "";
- public String one_line_description = "";
- public String long_description = "";
- public String message_footer = "";
-
- public Visibility listVisibility = Visibility.Nobody;
- public Visibility membershipVisibility = Visibility.Nobody;
- public Visibility archiveVisibility = Visibility.Members;
- public Action defaultPostingType = Action.Hold;
-
- public int bounceThreshhold = 10;
-
- public static MailingList getList(Object all, String listName) { return (MailingList)((Hashtable)all).get(listName); }
- public static MailingList getList(final String listName) {
- try {
- return (MailingList)p.execute(new Query() { public Object query(Object o, Date now) { return getList(o, listName); } });
- } catch (Exception e) {
- Log.error(MailingList.class, e);
- return null;
- }
- }
-
- public synchronized Subscriber getSubscriber(Address subscriber) {
- Subscriber s = (Subscriber)subscribers.get(subscriber.toString(false));
- if (s == null) subscribers.put(subscriber, s = new Subscriber());
- return s;
+import java.net.*;
+import javax.servlet.*;
+import javax.servlet.http.*;
+
+// TODO: RFC 2369
+// TODO: RFC 2919
+
+// FEATURE: store interesting/important stuff in sqlite
+public class MailingList extends Mailbox.MailboxWrapper {
+
+ // FIXME
+ public MailingList(File path, FileBasedMailbox fbm) throws IOException {
+ super(fbm);
+ this.path = path;
+ this.mailbox = fbm;
+ properties = new PropertiesFile(new File(path.getCanonicalPath() + File.separatorChar + "properties"));
+ address = new Address(properties.get("address"));
+ homepage = properties.get("homepage");
+ one_line_description = properties.get("description");
+ message_footer = properties.get("footer");