@Override protected ChannelUpstreamHandler createCoreHandler() { SMTPProtocol protocol = new SMTPProtocol(getProtocolHandlerChain(), lmtpConfig); return new SMTPChannelUpstreamHandler(protocol, lmtpMetrics); }
@Override public ProtocolSession newSession(ProtocolTransport transport) { return new SMTPSessionImpl(transport, (SMTPConfiguration) getConfiguration()); }
public void start() throws Exception { Logger logger = new LMTPProtocolLogger(); LMTPProtocolHandlerChain chain = new LMTPProtocolHandlerChain(); chain.add(0, new ElasticInboxDeliveryHandler(backend)); chain.add(0, new ValidRcptHandler()); chain.wireExtensibleHandlers(); server = new NettyServer(new SMTPProtocol(chain, new LMTPServerConfig(), logger)); server.setListenAddresses(new InetSocketAddress(Configurator.getLmtpPort())); server.setMaxConcurrentConnections(Configurator.getLmtpMaxConnections()); server.setTimeout(LMTPServerConfig.CONNECTION_TIMEOUT); server.setUseExecutionHandler(true, 16); server.bind(); }
private Protocol createProtocol(Optional<ProtocolHandler> handler) throws WiringException { SMTPProtocolHandlerChain chain = new SMTPProtocolHandlerChain(new NoopMetricFactory()); if (handler.isPresent()) { chain.add(handler.get()); } chain.wireExtensibleHandlers(); return new SMTPProtocol(chain, new SMTPConfigurationImpl()); }
@Override protected Protocol createProtocol(ProtocolHandler... handlers) throws WiringException { LMTPProtocolHandlerChain chain = new LMTPProtocolHandlerChain(); List<ProtocolHandler> hList = new ArrayList<>(); for (ProtocolHandler handler : handlers) { if (handler instanceof MessageHook) { handler = new MessageHookAdapter((MessageHook) handler); } hList.add(handler); } chain.addAll(0, hList); chain.wireExtensibleHandlers(); return new SMTPProtocol(chain, new LMTPConfigurationImpl()); }
private Protocol createProtocol(Optional<ProtocolHandler> handler) throws WiringException { SMTPProtocolHandlerChain chain = new SMTPProtocolHandlerChain(new NoopMetricFactory()); if (handler.isPresent()) { chain.add(handler.get()); } chain.wireExtensibleHandlers(); return new SMTPProtocol(chain, new SMTPConfigurationImpl()); }
protected Protocol createProtocol(ProtocolHandler... handlers) throws WiringException { SMTPProtocolHandlerChain chain = new SMTPProtocolHandlerChain(new NoopMetricFactory()); chain.addAll(0, Arrays.asList(handlers)); chain.wireExtensibleHandlers(); return new SMTPProtocol(chain, new SMTPConfigurationImpl()); }
protected Protocol createProtocol(ProtocolHandler... handlers) throws WiringException { SMTPProtocolHandlerChain chain = new SMTPProtocolHandlerChain(new NoopMetricFactory()); chain.addAll(0, Arrays.asList(handlers)); chain.wireExtensibleHandlers(); return new SMTPProtocol(chain, new SMTPConfigurationImpl()); }