private boolean mayChangeDefaultDomain() { return autoDetect && Domain.LOCALHOST.equals(defaultDomain); }
public static boolean isSpecialAddress(MailAddress mailAddress) { return mailAddress.getDomain().equals(AddressMarker.ADDRESS_MARKER); } }
@Override public void configure(HierarchicalConfiguration config) throws ConfigurationException { try { // Get postmaster String postMasterAddress = config.getString("postmaster", "postmaster").toLowerCase(Locale.US); // if there is no @domain part, then add the first one from the // list of supported domains that isn't localhost. If that // doesn't work, use the hostname, even if it is localhost. if (postMasterAddress.indexOf('@') < 0) { Domain domainName = domains.getDomains().stream() .filter(domain -> !Domain.LOCALHOST.equals(domain)) .findFirst() .orElse(domains.getDefaultDomain()); postMasterAddress = postMasterAddress + "@" + domainName.asString(); } try { this.postmaster = new MailAddress(postMasterAddress); if (!domains.containsDomain(postmaster.getDomain())) { LOGGER.warn("The specified postmaster address ( {} ) is not a local " + "address. This is not necessarily a problem, but it does mean that emails addressed to " + "the postmaster will be routed to another server. For some configurations this may " + "cause problems.", postmaster); } } catch (AddressException e) { throw new ConfigurationException("Postmaster address " + postMasterAddress + "is invalid", e); } } catch (DomainListException e) { throw new ConfigurationException("Unable to access DomainList", e); } }
if (!domain.equals(Domain.LOCALHOST)) {