added better message to Drop
[org.ibex.mail.git] / src / org / ibex / mail / target / Drop.java
index 7663936..f276871 100644 (file)
@@ -11,7 +11,10 @@ import org.ibex.mail.target.*;
 
 public class Drop extends JS.Obj implements Target {
     public static final Drop instance = new Drop();
+    public final String reason;
+    public Drop() { this(null); }
+    public Drop(String reason) { this.reason = reason; }
     public void accept(Message m) throws IOException, MailException {
-        Log.warn(this, "dropping message " + m.summary());
+        Log.warn(this, "dropping" +(reason==null?"":(" because "+reason))+ ": " + m.summary());
     }
 }