total overhaul; were using MIME and MIME.Part now
[org.ibex.mail.git] / src / org / ibex / mail / Address.java
index 0cbc494..041c598 100644 (file)
@@ -39,4 +39,16 @@ public class Address extends JSReflection {
         Log.warn(this, "returning false");
         return false;
     }
+
+    public static Address[] list(String spec) {
+        if (spec == null) return new Address[] { };
+        StringTokenizer st = new StringTokenizer((String)spec, ",");
+        Address[] ret = new Address[st.countTokens()];
+        for(int i=0; i<ret.length; i++) {
+            String s = st.nextToken();
+            ret[i] = Address.parse(s);
+            if (ret[i] == null) Log.warn(Address.class, "Warning: address " + s + " is unparseable");
+        }
+        return ret;
+    }
 }