Should this be a daemon service or not?



Hi

I have a simple test application that recieves txt(an email) from an
external program on System.in

The text comes from a Postfix mail server that can deliver a mail
message to another program via a pipe.

Essentailly the Postfix command I use is this....

postfix|java -classpath /test/bin/ bounceUtil.ExternalTest

This all works fine with a single test, the mail gets processed by my
java program correctly etc.

What I need to know is how do I run this application so it continuosly
waits for new mail on System.in from Postfix and when it recieves
something then processes it. There could be long periods of no action
then a flood of emails being piped by Postfix.

Should I be looking to run this as a Unix daemon with somesort of java
service wrapper? Is there a simpler way?

Any pointers much appreciated.
(Mac OSX)

.



Relevant Pages