All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jlot.mailing.config.GreenMailConfig Maven / Gradle / Ivy

There is a newer version: 1.2
Show newest version
package org.jlot.mailing.config;

import javax.inject.Inject;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Profile;

import com.icegreen.greenmail.util.GreenMail;
import com.icegreen.greenmail.util.ServerSetup;

@Configuration
@Profile({ "development", "integration" })
public class GreenMailConfig
{
	@Inject
	private MailSenderConfig mailSenderConfig;

	@Bean
	public GreenMail greenMail ( )
	{
		int portOffset = mailSenderConfig.getPortOffset();
		ServerSetup serverSetup = new ServerSetup(25 + portOffset, null, ServerSetup.PROTOCOL_SMTP);
		final GreenMail greenMail = new GreenMail(serverSetup);
		greenMail.start();
		return greenMail;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy