Ejemplo n.º 1
0
 public void stop() {
   log.debug("stopping mail server components...");
   if (mailSender != null) {
     try {
       mailSender.stop();
     } catch (Throwable e) {
       log.debug("exception stopping mailsender: " + e.getMessage());
     }
   }
   if (smtpServer != null) {
     try {
       smtpServer.stop();
     } catch (Throwable e) {
       log.debug("exception stopping smtp server: " + e.getMessage());
     }
   }
   if (msaSmtpServer != null) {
     try {
       msaSmtpServer.stop();
     } catch (Throwable e) {
       log.debug("exception stopping msa server: " + e.getMessage());
     }
   }
   if (popServer != null) {
     try {
       popServer.stop();
     } catch (Throwable e) {
       log.debug("exception stopping pop server: " + e.getMessage());
     }
   }
   log.debug("...done stopping mail servers");
 }
Ejemplo n.º 2
0
 public void start() {
   log.debug("starting mail servers...");
   if (mailSender != null) {
     log.debug("starting mail sender..");
     mailSender.start();
   }
   if (smtpServer != null) {
     log.debug("starting smtp receiver..");
     smtpServer.start();
   }
   if (msaSmtpServer != null) {
     log.debug("starting authenticated smtp server..");
     if (smtpServer != null && smtpServer.getSmtpPort() == msaSmtpServer.getSmtpPort()) {
       log.error(
           "The Authenticated SMTP server is configured to run on the same port as the un-authenticated server: "
               + msaSmtpServer.getSmtpPort()
               + ". The authenticated one should be on 587 and non-auth on 25. See - http://www.ietf.org/rfc/rfc2476.txt");
     } else {
       msaSmtpServer.start();
     }
   }
   if (popServer != null) {
     log.debug("starting pop server..");
     popServer.start();
   }
   log.debug("...done loading mail servers");
 }