// Path: src/main/java/de/gessnerfl/fakesmtp/config/FakeSmtpConfigurationProperties.java
// @Component
// @ConfigurationProperties(prefix = "fakesmtp")
// public class FakeSmtpConfigurationProperties {
// 
//     private static final int DEFAULT_PORT = 25;
// 
//     @NotNull
//     private Integer port = DEFAULT_PORT;
//     private InetAddress bindAddress;
//     private Authentication authentication;
//     private String filteredEmailRegexList;
//     private boolean forwardEmails = false;
// 
//     @NotNull
//     private Persistence persistence = new Persistence();
// 
//     public Integer getPort() {
//         return port;
//     }
// 
//     public void setPort(Integer port) {
//         this.port = port;
//     }
// 
//     public InetAddress getBindAddress() {
//         return bindAddress;
//     }
// 
//     public void setBindAddress(InetAddress bindAddress) {
//         this.bindAddress = bindAddress;
//     }
// 
//     public Authentication getAuthentication() {
//         return authentication;
//     }
// 
//     public void setAuthentication(Authentication authentication) {
//         this.authentication = authentication;
//     }
// 
//     public Persistence getPersistence() {
//         return persistence;
//     }
// 
//     public void setPersistence(Persistence persistence) {
//         this.persistence = persistence;
//     }
// 
//     public String getFilteredEmailRegexList() {
//         return filteredEmailRegexList;
//     }
// 
//     public void setFilteredEmailRegexList(String filteredEmailRegexList) {
//         this.filteredEmailRegexList = filteredEmailRegexList;
//     }
// 
//     public boolean isForwardEmails() {
//         return forwardEmails;
//     }
// 
//     public void setForwardEmails(boolean forwardEmails) {
//         this.forwardEmails = forwardEmails;
//     }
// 
//     public static class Authentication {
//         @NotNull
//         private String username;
//         @NotNull
//         private String password;
// 
//         public String getUsername() {
//             return username;
//         }
// 
//         public void setUsername(String username) {
//             this.username = username;
//         }
// 
//         public String getPassword() {
//             return password;
//         }
// 
//         public void setPassword(String password) {
//             this.password = password;
//         }
//     }
// 
//     public static class Persistence {
//         static final int DEFAULT_MAX_NUMBER_EMAILS = 100;
// 
//         @NotNull
//         private Integer maxNumberEmails = DEFAULT_MAX_NUMBER_EMAILS;
// 
//         public Integer getMaxNumberEmails() {
//             return maxNumberEmails;
//         }
// 
//         public void setMaxNumberEmails(Integer maxNumberEmails) {
//             this.maxNumberEmails = maxNumberEmails;
//         }
//     }
// }


import de.gessnerfl.fakesmtp.config.FakeSmtpConfigurationProperties;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import org.subethamail.smtp.auth.EasyAuthenticationHandlerFactory;
import org.subethamail.smtp.server.SMTPServer;
package de.gessnerfl.fakesmtp.server.impl;


@Service
public class SmtpServerConfigurator {

    private final FakeSmtpConfigurationProperties fakeSmtpConfigurationProperties;
    private final BasicUsernamePasswordValidator basicUsernamePasswordValidator;
    private final Logger logger;

    @Autowired
    public SmtpServerConfigurator(FakeSmtpConfigurationProperties fakeSmtpConfigurationProperties, BasicUsernamePasswordValidator basicUsernamePasswordValidator, Logger logger) {
        this.fakeSmtpConfigurationProperties = fakeSmtpConfigurationProperties;
        this.basicUsernamePasswordValidator = basicUsernamePasswordValidator;
// Path: src/main/java/de/gessnerfl/fakesmtp/config/FakeSmtpConfigurationProperties.java
// @Component
// @ConfigurationProperties(prefix = "fakesmtp")
// public class FakeSmtpConfigurationProperties {
// 
//     private static final int DEFAULT_PORT = 25;
// 
//     @NotNull
//     private Integer port = DEFAULT_PORT;
//     private InetAddress bindAddress;
//     private Authentication authentication;
//     private String filteredEmailRegexList;
//     private boolean forwardEmails = false;
// 
//     @NotNull
//     private Persistence persistence = new Persistence();
// 
//     public Integer getPort() {
//         return port;
//     }
// 
//     public void setPort(Integer port) {
//         this.port = port;
//     }
// 
//     public InetAddress getBindAddress() {
//         return bindAddress;
//     }
// 
//     public void setBindAddress(InetAddress bindAddress) {
//         this.bindAddress = bindAddress;
//     }
// 
//     public Authentication getAuthentication() {
//         return authentication;
//     }
// 
//     public void setAuthentication(Authentication authentication) {
//         this.authentication = authentication;
//     }
// 
//     public Persistence getPersistence() {
//         return persistence;
//     }
// 
//     public void setPersistence(Persistence persistence) {
//         this.persistence = persistence;
//     }
// 
//     public String getFilteredEmailRegexList() {
//         return filteredEmailRegexList;
//     }
// 
//     public void setFilteredEmailRegexList(String filteredEmailRegexList) {
//         this.filteredEmailRegexList = filteredEmailRegexList;
//     }
// 
//     public boolean isForwardEmails() {
//         return forwardEmails;
//     }
// 
//     public void setForwardEmails(boolean forwardEmails) {
//         this.forwardEmails = forwardEmails;
//     }
// 
//     public static class Authentication {
//         @NotNull
//         private String username;
//         @NotNull
//         private String password;
// 
//         public String getUsername() {
//             return username;
//         }
// 
//         public void setUsername(String username) {
//             this.username = username;
//         }
// 
//         public String getPassword() {
//             return password;
//         }
// 
//         public void setPassword(String password) {
//             this.password = password;
//         }
//     }
// 
//     public static class Persistence {
//         static final int DEFAULT_MAX_NUMBER_EMAILS = 100;
// 
//         @NotNull
//         private Integer maxNumberEmails = DEFAULT_MAX_NUMBER_EMAILS;
// 
//         public Integer getMaxNumberEmails() {
//             return maxNumberEmails;
//         }
// 
//         public void setMaxNumberEmails(Integer maxNumberEmails) {
//             this.maxNumberEmails = maxNumberEmails;
//         }
//     }
// }


// Path: src/main/java/de/gessnerfl/fakesmtp/server/impl/SmtpServerConfigurator.java
import de.gessnerfl.fakesmtp.config.FakeSmtpConfigurationProperties;
import org.slf4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import org.subethamail.smtp.auth.EasyAuthenticationHandlerFactory;
import org.subethamail.smtp.server.SMTPServer;

package de.gessnerfl.fakesmtp.server.impl;


@Service
public class SmtpServerConfigurator {

    private final FakeSmtpConfigurationProperties fakeSmtpConfigurationProperties;
    private final BasicUsernamePasswordValidator basicUsernamePasswordValidator;
    private final Logger logger;

    @Autowired
    public SmtpServerConfigurator(FakeSmtpConfigurationProperties fakeSmtpConfigurationProperties, BasicUsernamePasswordValidator basicUsernamePasswordValidator, Logger logger) {
        this.fakeSmtpConfigurationProperties = fakeSmtpConfigurationProperties;
        this.basicUsernamePasswordValidator = basicUsernamePasswordValidator;
        this.logger = logger;