How can I optimize sendmail for use with JavaMail-based programs?
JavaMail checks if the connection is good by sending a NOOP command. It does this before sending each mail message. The problem is that after 19 NOOPs sendmail starts slowing down. To fix this (if you control the mail server) is to set MAXNOOPCOMMANDS to 0 in sendmail/srvrsmtp.c and recompile sendmail. If you don't control the server you have to count how many messages you send and reconnect after 19 of them.