- //org.ibex.mail.protocol.SMTP.Outgoing.accept(message);
- boolean ok = org.ibex.mail.protocol.SMTP.Outgoing.attempt(message);
- if (!ok) throw new JSExn("SMTP server rejected message");
- return JSU.T;
+
+ boolean ok = false;
+ try {
+ if (attempt) {
+ org.ibex.mail.protocol.SMTP.Outgoing.attempt(message);
+ } else {
+ org.ibex.mail.protocol.SMTP.Outgoing.accept(message);
+ }
+ ok = true;
+ } catch (Exception ex) {
+ if (!attempt) Log.warn(this, ex);
+ }
+ if (!ok && !attempt) throw new JSExn("SMTP server rejected message");
+ return JSU.B(ok);
+ }
+ if (name.equals("mail.bounce")) {
+ return new JSTarget() {
+ public void accept(Message m) throws MailException {
+ try {
+ Message m2 = m.bounce(JSU.toString(a));
+ org.ibex.mail.protocol.SMTP.Outgoing.accept(m2);
+ Log.error(this, "BOUNCING! " + m2.summary());
+ } catch (Exception e) {
+ Log.warn(this, e);
+ }
+ } };