you have to "send" the mail using the mailet context, and GHOST the original so that it re-enters from the top, alternatively copy the message and send that in a new mail to the cc recipient.
Mail message headers *don't* control the recipients of the email, strange but true. d. > -----Original Message----- > From: Shal Jain [mailto:[EMAIL PROTECTED] > Sent: 01 July 2003 16:45 > To: James Users List > Subject: Mailet question > > > James vers 2.1.2 > OS - Win2K > > I have a mailet that monitors all outbound messages and under certain > conditions adds a CC recipient > I know the mailet executes because the headers of the outbound > messages show > the added CC recipient address. > However, the message is not delivered to this special address. > The SMTP log shows message being spooled to all other recipients > (to/cc/bcc) > except for the one that I added > > I am including the service method as well as the changes to the config.xml > file. > > What am I missing ? > > > > > The service method looks somewhat like this > > > public void service(Mail mailObj) throws javax.mail.MessagingException > { > MimeMessage msg = mailObj.getMessage(); > boolean evalSuccess = evalConditions(); > if (evalSuccess) > { > msg.addRecipients(Message.RecipientType.CC, [EMAIL PROTECTED]); > } > } > > > > In the config file the the mailet has been configured at the very begining > of the transport processor > > <processor name="transport"> > > <!-- add custom address to the CC List --> > <mailet match="All" class="CCSender" /> <-- my mailet > > <!-- Is the recipient is for a local account, deliver it locally --> > <mailet match="RecipientIsLocal" class="LocalDelivery"/> > > <!-- If the host is handled by this server and it did not get --> > <!-- locally delivered, this is an invalid recipient --> > <mailet match="HostIsLocal" class="ToProcessor"> > <processor>error</processor> > </mailet> > ... > --- rest of the transport processort block --> > </processor> > > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] >