Package com.icegreen.greenmail.util

Examples of com.icegreen.greenmail.util.ServerSetup


  }

  @Override
  protected ServerSetup setupReceiveServer() {
    return new ServerSetup(port, "localhost", protocol);
  }
View Full Code Here


    return new ServerSetup(port, "localhost", protocol);
  }

  @Override
  protected ServerSetup setupSendServer() {
    return new ServerSetup(smtpPort, "localhost", "smtp");
  }
View Full Code Here

    @Setup @SuppressWarnings("unused")
    private void setUp(LogManager logManager, PortAllocator portAllocator) throws Exception {
        this.logManager = logManager;
        this.portAllocator = portAllocator;
        smtpServerSetup = new ServerSetup(portAllocator.allocatePort(), "127.0.0.1", ServerSetup.PROTOCOL_SMTP);
        storeServerSetup = new ServerSetup(portAllocator.allocatePort(), "127.0.0.1", protocol);
        greenMail = new GreenMail(new ServerSetup[] { smtpServerSetup, storeServerSetup });
        greenMail.start();
        smtpTunnel = new Tunnel(new InetSocketAddress("127.0.0.1", smtpServerSetup.getPort()));
        smtpTunnel.start();
        unallocatedAccounts = new LinkedList<Account>();
View Full Code Here

  private int port = DEFAULT_PORT;

  @Override
  public void afterPropertiesSet() throws Exception {
    greenMail = new GreenMail(new ServerSetup(port, null, ServerSetup.PROTOCOL_SMTP));
    greenMail.setUser(account, password);
    greenMail.start();
  }
View Full Code Here

    private JavaMailSender mailSender;

    @BeforeClass
    public static void startGreenMail() {
        ServerSetup[] config = new ServerSetup[2];
        config[0] = new ServerSetup(SMTP_PORT, SMTP_HOST, ServerSetup.PROTOCOL_SMTP);
        config[1] = new ServerSetup(POP3_PORT, POP3_HOST, ServerSetup.PROTOCOL_POP3);
        greenMail = new GreenMail(config);
        greenMail.setUser(MAIL_ADDRESS, MAIL_PASSWORD);
        greenMail.start();
    }
View Full Code Here

     * @return An array of {@link ServerSetup} used to configure the embedded Greenmail server.
     */
    private ServerSetup[] getServerSetups() {
        if (isUseSSL()) {
            return new ServerSetup[]{
                    new ServerSetup(465 + getPortOffset(), null, ServerSetup.PROTOCOL_SMTPS),
                    new ServerSetup(995 + getPortOffset(), null, ServerSetup.PROTOCOL_POP3S),
                    new ServerSetup(993 + getPortOffset(), null, ServerSetup.PROTOCOL_IMAPS)
            };
        } else {
            return new ServerSetup[]{
                    new ServerSetup(25 + getPortOffset(), null, ServerSetup.PROTOCOL_SMTP),
                    new ServerSetup(110 + getPortOffset(), null, ServerSetup.PROTOCOL_POP3),
                    new ServerSetup(143 + getPortOffset(), null, ServerSetup.PROTOCOL_IMAP)
            };
        }
    }
View Full Code Here

import javax.mail.internet.MimeMessage.RecipientType;

public class MailServer {

    public static void main(String[] args) throws Exception {
        ServerSetup setup = new ServerSetup(3025, "localhost", "smtp");

        GreenMail greenMail = new GreenMail(setup);
        greenMail.start();

        System.out.println("Started mail server (localhost:3025)");
View Full Code Here

    @GET
    @Path("start")
    @Produces("application/json")
    public synchronized Status start() {
        if (greenMail == null) {
            ServerSetup setup = new ServerSetup(3025, "localhost", "smtp");

            greenMail = new GreenMail(setup);
            try {
                greenMail.start();
            } catch (Throwable t) {
View Full Code Here

    private GreenMail greenMail;

    @Override
    protected void before() throws Throwable {
        ServerSetup setup = new ServerSetup(3025, "localhost", "smtp");

        greenMail = new GreenMail(setup);
        greenMail.start();
    }
View Full Code Here

TOP

Related Classes of com.icegreen.greenmail.util.ServerSetup

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.