}
// FIXME: this should extend org.ibex.core.Ibex
- public static class ScriptEnv extends JS {
+ public class ScriptEnv extends JS {
- private static PropertyFile prefs = null;
+ private PropertyFile prefs = null;
/*
static {
try {
if (name.startsWith("list.")) { return org.ibex.mail.List.getList(name.substring(5)); }
if (name.equals("mail")) { return getSub("mail"); }
if (name.equals("mail.forward")) { return METHOD; }
+ if (name.equals("mail.forward2")) { return METHOD; }
if (name.equals("mail.send")) { return METHOD; }
if (name.equals("mail.my")) { return getSub("mail.my"); }
if (name.equals("mail.my.prefs")) {
if (!ok) throw new JSExn("SMTP server rejected message");
return T;
}
+ if (name.equals("mail.forward2")) {
+ try {
+ Message m2 = Message.newMessage(new org.ibex.io.Stream(m.toString()),
+ m.envelopeFrom,
+ new Address(a.toString()));
+ org.ibex.mail.protocol.SMTP.Outgoing.accept(m2);
+ } catch (Exception e) {
+ Log.warn(this, e);
+ throw new JSExn(e.toString());
+ }
+ return null;
+ }
if (name.equals("mail.forward")) { return new Target() {
public void accept(Message m) throws MailException {
try {
throw new JSExn("invalid number of arguments ("+nargs+") for ibex object method "+name+"()");
}
- public static final JSMath ibexMath = new JSMath() {
+ public final JSMath ibexMath = new JSMath() {
private JS gs = new JSScope.Global();
public Object get(Object name) throws JSExn {
if (name.equals("isNaN")) { return gs.get("isNaN"); }
}
};
- public static final JS ibexString = new JS() {
+ public final JS ibexString = new JS() {
private JS gs = new JSScope.Global();
public void put(Object key, Object val) { }
public Object get(Object name) throws JSExn {