major simplifications to Iterator api
[org.ibex.mail.git] / src / org / ibex / mail / target / Drop.java
1 // Copyright 2000-2005 the Contributors, as shown in the revision logs.
2 // Licensed under the Apache Public Source License 2.0 ("the License").
3 // You may not use this file except in compliance with the License.
4
5 package org.ibex.mail.target;
6 import java.io.*;
7 import org.ibex.js.*;
8 import org.ibex.util.*;
9 import org.ibex.mail.*;
10 import org.ibex.mail.target.*;
11
12 public class Drop extends JS.Obj implements Target {
13     public static final Drop instance = new Drop();
14     public final String reason;
15     public Drop() { this(null); }
16     public Drop(String reason) { this.reason = reason; }
17     public void accept(Message m) throws IOException, MailException {
18         Log.warn(this, "dropping" +(reason==null?"":(" because "+reason))+ ": " + m.summary());
19     }
20 }