Where do you stick the custom mailets in the 2.1a build?
There's no james/lib dfirectory or james.bar (has it changed to james.sar
now?)

Also, once I specifiy a custome mailet it gives me this error.

org/apache/avalon/cornerstone/services/store/Store
--- Stack Trace ---
java.lang.NoClassDefFoundError:
org/apache/avalon/cornerstone/services/store/Store

If I remove the custom mailet from the config file, it keeps giving me the
same exception. Plus what's the deal with generating those directories
under the JAMES_HOME/work directory? It seems that the files are being
extracted from the james.sar file.

For the current solution I've made my own mailet which simply extends the
RemoteDelivery and copied some code from the Forward class. Here's the
source for anyone interested.

import org.apache.mailet.GenericMailet;
import org.apache.mailet.Mail;
import org.apache.mailet.MailAddress;

import javax.mail.MessagingException;
import java.util.Collection;
import java.util.HashSet;
import java.util.StringTokenizer;

/**
 * Replace incoming recipient with specified ones.
 *
 * @author Federico Barbieri <[EMAIL PROTECTED]>
 * @author Serge Knystautas <[EMAIL PROTECTED]>
 */
public class Forward extends GenericMailet {

    private Collection newRecipients;

    public void init() throws MessagingException {
        newRecipients = new HashSet();
        StringTokenizer st = new StringTokenizer(getMailetConfig
().getInitParameter("forwardto"), ",", false);
        while (st.hasMoreTokens()) {
            newRecipients.add(new MailAddress(st.nextToken()));
        }
    }

    public void service(Mail mail) throws MessagingException {
        getMailetContext().sendMail(mail.getSender(), newRecipients,
mail.getMessage());
        mail.setState(Mail.GHOST);
    }

    public String getMailetInfo() {
        return "Forward Mailet";
    }
}

BTW, My first name is Minh + can you invert the match result? eg
<mailet match="RecipientIs!=blah@blah" class="Mailet">
I've been copying and classes and inverting the results.




                                                                                       
                                                
                      "Danny Angus"                                                    
                                                
                      <[EMAIL PROTECTED]        To:       "James Users List" 
<[EMAIL PROTECTED]>                            
                      >                        cc:                                     
                                                
                                               Subject:  RE: Forwarding mail           
                                                
                      08/21/02 08:15 PM                                                
                                                
                      Please respond to                                                
                                                
                      "James Users                                                     
                                                
                      List"                                                            
                                                
                                                                                       
                                                
                                                                                       
                                                




Forward didn't support passthrough until *after* 2.0a3 was released.

(Minh Chiem might like to evaluate the "latest" build from
http://jakarta.apache.org/builds/jakarta-james/latest/ in which forward
supports this attribute.)

d.

> -----Original Message-----
> From: Noel J. Bergman [mailto:[EMAIL PROTECTED]]
> Sent: 21 August 2002 08:06
> To: James Users List
> Subject: RE: Forwarding mail
>
>
> What version of James?  I use Forward to accomplish this task
> today, I don't
> believe that older versions of Forward honored the passthrough option
(I'd
> have to check the log to see when that changed).  You could also try
using
> Redirect.
>
>            --- Noel
>
> -----Original Message-----
> From: Minh Chiem [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 21, 2002 3:04
> To: James Users List
> Subject: RE: Forwarding mail
>
> I've tested the RecipientIsNot mailet and there are no problems except
the
> original recipient never gets the mail. With the current mailets, is it
> possible to forward mail to a third party as well as the original
> recipients?
>
>
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]
>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]
>






--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to