Ok i try to explain you why i need that headers.

I try to integrate DSPAM (dspam.nuclearelephant.com) as Mailet. Dspam
must process each message for each recipient (the recipient is the user
for dspam ) and add user specified siganture etc in the header. 

Cause i have about 2000+ Domains i don'T want to check each domain
agains HostIs. So the main idea was to create a mailet that split the
message for each recipient and add the the recipient and domain of the
recipient to it as attribute or header.

After that it will go to the dspam mailet and dspam grab the user it
should use out of the headers or the attributes.

Maybe there is a better way. 

I need to process the message for each recip cause dspam use one "spam
db" per user.. 

bye

Am Dienstag, den 28.02.2006, 11:15 +0100 schrieb Stefano Bagnara:
> Norman Maurer wrote:
> > If i use:
> > getMailetContext().sendMail(mail.getSender(), new
> > MailAddress[]{recipient}.asList(), message, "testProcessor");
> > 
> > i get:
> > Cannot invoke asList() on the array type MailAddress[]
> 
> Sorry, I wrote it too fast:
> Arrays.asList(new MailAddress[]{recipient});
> 
> > i have found the error.. it was a ClassCast exception .. logged in spool
> > log.
> 
> the "(MimeMessage) mail" is you classcast.
> 
> > I cast the mail.getMessage(); to MimeMessage cause i want to add headers
> > and save them after that:
> 
> mail.getMessage() is alreade a MimeMessage.
> You were casting a Mail to MimeMessage.
> 
> > MimeMessage message = newMail.getMessage();
> > 
> > message.addHeader("X-User", user);
> > message.addHeader("X-Domain", domain);
> > message.saveChanges();
> > 
> > I also have removed the mail.setAttributes(); methods. cause the values
> > get lost afet send the message .. 
> 
> You don't need them! You have the corrent sender and the corrent 
> recipient in the sent mail: use it!
> I simply don't understand why you should parse the message to add 
> headers when you already have the informations in the Mail object 
> processed by the spool.
> 
> > So i want add the headers and get the values i need later out of the
> > headers.
> 
> "later" => WHEN? why? inside james? outside james?
> 
> Stefano
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


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

Reply via email to