To write a program that automatically responds to email, is it best to use an MUA approach (like JavaMail API) or to do something with the mail server (MTA)?

Serge Knystautas

I think the MTA approach works better as it is more reliable. You can channel all messages through your MTA and fire actions accordingly. With the MUA approach, you consume network resources by keeping connections open and risk failure if the connection is temporarily down. With the MTA approach, if your MTA goes down, the messages will queue in the previous hop until your system is restored, and you only use a connection when a message is actually transfered.