Пример #1
0
 @Override
 protected void startup() {
   smtpServer = new SMTPServer(new SimpleMessageListenerAdapter(this));
   smtpServer.setSoftwareName(getName());
   smtpServer.setPort(port);
   smtpServer.start();
 }
 public void activate(ComponentContext context) throws Exception {
   final String port = System.getProperty("org.sakaiproject.nakamura.SMTPServerPort", "8025");
   LOGGER.info("Starting SMTP server on port {}", port);
   server = new SMTPServer(new SimpleMessageListenerAdapter(this));
   server.setPort(Integer.parseInt(port));
   server.start();
   String localDomains = (String) context.getProperties().get(LOCAL_DOMAINS);
   if (localDomains == null) {
     localDomains = "localhost";
   }
   domains.clear();
   for (String domain : StringUtils.split(localDomains, ';')) {
     domains.add(domain);
   }
 }