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 where the 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 -----
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

Reply via email to