Norman Maurer wrote:
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:
What is the error that place it into error?
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);
You don't need to sent this attributes: the mail sender and recipients
will be there.
getMailetContext().sendMail(mail.getSender(), recipients,
(MimeMessage) newMail,"testProcessor");
You should send each mail to the single recipient.
So put here a single "recipient" and not "recipients" or it won't work
correctly.
---------------
for (.....) {
MailAddress recipient = (MailAddress) i.next();
getMailetContext().sendMail(mail.getSender(), new
MailAddress[]{reciepient}.asList(),mail.getMessage(),"testProcessor").
}
-------------
I don't understand why you cast Mail to MimeMessage: that's wrong.
Mail.getMessage() will give you the message.
So the prob must be the SplitMail mailet.. what im doing wrong ?
If a mail goes to "error" James should log an error: Look in the logs.
Stefano
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]