// Initialize the logging mechanism. We want to do this before we do
// anything else.
initializeLogging( directory );
// Initialize the Configuration Manager.
ConfigurationManager configurationManager = ConfigurationManager.initialize( directory );
//Start the threads.
int port;
int executeThreads = configurationManager.getExecuteThreadCount();
//Start the Pop3 Thread.
port = configurationManager.getPop3Port();
if( log.isDebugEnabled() ) log.debug( "Starting POP3 Service on port: " + port );
popListener = new ServiceListener( port, Pop3Processor.class, executeThreads );
new Thread( popListener, "POP3" ).start();
//Start SMTP Threads.
port = configurationManager.getSmtpPort();
if( log.isDebugEnabled() ) log.debug( "Starting SMTP Service on port: " + port );
smtpListener = new ServiceListener( port, SMTPProcessor.class, executeThreads );
new Thread( smtpListener, "SMTP" ).start();
//Start the SMTPSender thread (This thread actually delivers the mail recieved