Ok just did it but if i set the processor with setstat or with passing
it directly in the sendMail() method it get sorred in error dir:

Here is what i did:

SplitDomain mailet snip:

    public void service(Mail mail) throws MessagingException
    {
        Collection recipients = mail.getRecipients();

        for (Iterator i = recipients.iterator(); i.hasNext();)
        {
            Mail newMail = mail;
            MailAddress recipient = (MailAddress) i.next();

            user = recipient.toString().toLowerCase();
            domain = recipient.getHost().toString().toLowerCase();
            senderUser = mail.getSender().toString().toLowerCase();
            senderDomain =
mail.getSender().getHost().toString().toLowerCase();

            newMail.setAttribute(DOMAIN_MAIL_ATTRIBUTE_NAME, domain);
            newMail.setAttribute(USER_MAIL_ATTRIBUTE_NAME, user);
            newMail.setAttribute(SENDER_DOMAIN_MAIL_ATTRIBUTE_NAME,
senderDomain);
            newMail.setAttribute(SENDER_USER_MAIL_ATTRIBUTE_NAME,
senderUser);

            getMailetContext().sendMail(mail.getSender(), recipients,
(MimeMessage) newMail,"testProcessor");

        }
        mail.setState(Mail.GHOST);
    }



config:

      <processor name="root">


         <!-- Important check to avoid looping -->
         <mailet match="RelayLimit=30" class="Null"/>

         <mailet match="All" class="SplitEmail">
         </mailet>

        </processor>




      <processor name="testProcessor">  
        ...
        ..
      </processor>



This not work..

if i do this in config it works:

      <processor name="root">

         <!-- Important check to avoid looping -->
         <mailet match="RelayLimit=30" class="Null"/>

         <mailet match="All" class="ToProcessor">
         <processor>testProcessor</processor>
         </mailet>

        </processor>



      <processor name="testProcessor">  
        ...
        ..
      </processor>

So the prob must be the SplitMail mailet.. what im doing wrong ?

bye



Am Montag, den 27.02.2006, 21:14 +0100 schrieb Stefano Bagnara:
> Norman Maurer wrote:
> > After do some test i realize that its not that easy that i thought :-(
> > 
> > I need a Matcher which lit the email in a email for each recipient so i
> > can check whitelist blacklsit etc for each of them. We have about 2000+
> > domains do process so the RecipientIS or HostIs will not be acceptable
> > cause the adminstration will be to much work.
> > 
> > The LocalDelivery store a ail for each recpient.. I nedd something that
> > work simalar.. I need to store an email for each recipient in the spool
> > for process them. Any hints or ideas ?
> 
> Follow the LocalDelivery code but send a new message everytime, instead 
> of storing the message.
> 
> getMailetContext().sendMail(newMail);
> 
> If you want your mail to start from a specific processor then your can 
> set the state newMail.setState(processorname);
> 
> Stefano
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> !EXCUBATOR:2,44035dfb89461507080717!


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

Reply via email to