Mailet question

2003-07-01 Thread Shal Jain
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
   processorerror/processor
 /mailet
  ...
  --- rest of the transport processort block --
 /processor







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



RE: Mailet question

2003-07-01 Thread Danny Angus
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
processorerror/processor
  /mailet
   ...
   --- rest of the transport processort block --
  /processor
 
 
 
 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 

Re: Mailet question

2003-07-01 Thread Kenny Smith
Here is a snippet from JDBCVirtualUserTable that does this kind of 
thing, so you know where to start searching:

getMailetContext().sendMail(mail.getSender(), recipientsToAddForward, 
mail.getMessage());

recipientsToAddForward is a Collection of MailAddress(es).

Kenny Smith
JournalScape.com
Danny Angus wrote:
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
  processorerror/processor
/mailet
 ...
 --- rest of the transport processort block --
/processor






-
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]


mailet question

2002-09-20 Thread Brian 'Bex' Huff


Im writing a mailet to interface with some stuff... and I have a quetion 
about the mailet-matcher APIs...

My custom mailet wants to do something special with the name of the 
recipient of the email, but the email message could have several 
recipients, and only one or two is special... Im using a RecipientIs 
matcher to execute the mailet, but it doesn't have to use that specific 
matcher.

Now, is there any easy way in the java code to ask what matcher caused 
this mailet to be executed and why ?  I can get at the context 
attributes, and the matcher field, but what can I do with it?

I cant seem to make a matcher manually in any clear fashion, nor does it 
look like I can get directly at the matcher from the mailet... very very 
odd.

Any idea would be helpful...

-- 

Brian 'Bex' Huff
[EMAIL PROTECTED]
Phone: 952-903-2023
Fax: 952-829-5424



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




RE: mailet question

2002-09-20 Thread Noel J. Bergman

A plan is for future version of the Mail interface to support attributes.
That might help you.

--- Noel

-Original Message-
From: Stefano Debenedetti [mailto:[EMAIL PROTECTED]]
Sent: Friday, September 20, 2002 11:53
To: James Users List
Subject: Re: mailet question


Brian 'Bex' Huff wrote:
 Now, is there any easy way in the java code to ask what matcher caused
 this mailet to be executed and why ?

I would need that too, I think the only way right now is to have your
matcher set up an attribute in the MailetContext that you mailet can
later retrieve but doesn't look very easy to me because of
multithreading issues

ciao
ste


--
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]




Config Mailet Question

2002-07-05 Thread Brian Lichtenwalter

I'd like to have two mailets: one for incoming mail and one for outgoing
mail.  And I'd like to have not defined any local users.  The incoming
mail would be a custom mailet and would lookup to see if the recipients
exist in a J2EE app server and process the mail.  The outgoing mail
could be a RemoteDelivery mailet.  The question is whether or not this
is doable w/o any local users defined and if it's doable then how would
the config xml mailets be written.

thanks,

Brian


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




Re: Config Mailet Question

2002-07-05 Thread Ramon Gonzalez

Hello,

I'm new to this list, but have been working with JAMES for about 4 months
and just recently was succesful in implementing a very customized mailing
list for my company.

As for the question, I guess it can be done. Add your custom mailets, then
in config.xml change in processor name transport from:

mailet match=HostIsLocal class=ToProcessor

processorerror/processor

/mailet

to do this:

mailet match=HostIsLocal class=Null

/mailet



For remote delivery you should not have to do anything. This will kill all
your incoming messages instead of filling your var/mail/error folder.



- Original Message -
From: Brian Lichtenwalter [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Friday, July 05, 2002 4:04 PM
Subject: Config Mailet Question


 I'd like to have two mailets: one for incoming mail and one for outgoing
 mail.  And I'd like to have not defined any local users.  The incoming
 mail would be a custom mailet and would lookup to see if the recipients
 exist in a J2EE app server and process the mail.  The outgoing mail
 could be a RemoteDelivery mailet.  The question is whether or not this
 is doable w/o any local users defined and if it's doable then how would
 the config xml mailets be written.

 thanks,

 Brian


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



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.368 / Virus Database: 204 - Release Date: 5/29/2002


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




Mailet Question

2001-06-30 Thread Bernstein, Marc (Marc)
Title: Mailet Question






I am looking to have JAMES automatically run a bat file when an incoming email matches a predetermined criteria.


Example: If email is from [EMAIL PROTECTED] run c:\test.bat. 


Is this possible? Does anyone have a similar example?


Thanks,

Marc Bernstein





Re: Mailet Question

2001-06-30 Thread Marc Chamberlin
Title: Mailet Question



Ah, a question I feel confident enough to answer! 
;-) (I mostly lurk myself and ask questions once in a while, so maybe I can pay 
back a bit...)

Since you are refering to a bat file, I presume you 
are working in a Windows environment.. So, the answer to your question is a 
qualified yes First, of course, you will have to write a mailet to be 
invoked when one of your matchers recognizes wherethe email came from. The 
James documentation describes the process of writing mailets and 
matchers,and installing them in the James server, and it is not to 
difficult of a procedure to follow

If you were to execute a straight forward 
executable file, you could execute it from a mailet, using the Java 
Runtime.exec() call from within your mailet code... However, bat files are 
usually interpreted by the Windows interpreter so the process becomes more 
difficult... Instead of trying to guide you through the necessary steps here, I 
will refer you to an excellent article at the following URL which goes into the 
details... http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

I don't have an example of doing exactly what you 
want to do, but have been through enough pain of writing Java code which invokes 
external processes that I had this URL bookmarked in all my browsers! It has 
been a lifesaver... ;-)

 Marc Chamberlin


  - Original Message - 
  From: 
  Bernstein, Marc 
  (Marc) 
  To: [EMAIL PROTECTED] 
  
  Sent: Saturday, June 30, 2001 7:39 
  AM
  Subject: Mailet Question
  
  I am looking to have JAMES automatically run a bat file when 
  an incoming email matches a predetermined criteria. 
  Example: If email is from "[EMAIL PROTECTED]" run "c:\test.bat". 
  
  Is this possible? Does anyone have a similar 
  example? 
  Thanks, Marc Bernstein