You are viewing a plain text version of this content. The canonical link for it is here.
Posted to server-dev@james.apache.org by se...@apache.org on 2001/08/11 23:32:10 UTC
cvs commit: jakarta-james/src/java/org/apache/james/transport/mailets/debug DumpSystemErr.java ExceptionThrowingMailet.java Identity.java
serge 01/08/11 14:32:10
Added: src/java/org/apache/james/transport/mailets/debug
DumpSystemErr.java ExceptionThrowingMailet.java
Identity.java
Log:
Moving development-time mailets to another package (and added DumpSystemErr mailet)
Revision Changes Path
1.1 jakarta-james/src/java/org/apache/james/transport/mailets/debug/DumpSystemErr.java
Index: DumpSystemErr.java
===================================================================
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE file.
*/
package org.apache.james.transport.mailets.debug;
import java.io.*;
import javax.mail.*;
import javax.mail.internet.*;
import org.apache.mailet.*;
/**
* Debugging purpose Mailet. Sends the message to System.err
*
* @author Serge Knystautas <se...@lokitech.com>
*/
public class DumpSystemErr extends GenericMailet {
public void service(Mail mail) throws MessagingException {
try {
MimeMessage message = mail.getMessage();
message.writeTo(System.err);
} catch (IOException ioe) {
log("error printing message", ioe);
}
}
public String getMailetInfo() {
return "Dumps message to System.err";
}
}
1.1 jakarta-james/src/java/org/apache/james/transport/mailets/debug/ExceptionThrowingMailet.java
Index: ExceptionThrowingMailet.java
===================================================================
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE file.
*/
package org.apache.james.transport.mailets.debug;
import javax.mail.*;
import org.apache.mailet.*;
/**
* Debugging purpose Mailet. Just throws an exception.
*
* @author Federico Barbieri <sc...@pop.systemy.it>
*/
public class ExceptionThrowingMailet extends GenericMailet {
public void service(Mail mail) throws MessagingException {
throw new MailetException("General protection fault");
}
public String getMailetInfo() {
return "ExceptionThrowingMailet Mailet";
}
}
1.1 jakarta-james/src/java/org/apache/james/transport/mailets/debug/Identity.java
Index: Identity.java
===================================================================
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE file.
*/
package org.apache.james.transport.mailets.debug;
import org.apache.mailet.*;
/**
* Opposite of Null Mailet. It let any incoming mail untouched. Used only for
* debugging.
* @author Federico Barbieri <sc...@pop.systemy.it>
*/
public class Identity extends GenericMailet {
public void service(Mail mail) {
//Do nothing
}
public String getMailetInfo() {
return "Identity Mailet";
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: james-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: james-dev-help@jakarta.apache.org