mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
ALF-1966 - Inbound email supports STARTTLS by default - however this requires Java + SSL configuration to be done to work
Updated to latest SubEtha lib and added three new configuration properties. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@30913 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -33,6 +33,15 @@
|
|||||||
<property name="allowedSenders">
|
<property name="allowedSenders">
|
||||||
<value>${email.server.allowed.senders}</value>
|
<value>${email.server.allowed.senders}</value>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="enableTLS">
|
||||||
|
<value>${email.server.enableTLS}</value>
|
||||||
|
</property>
|
||||||
|
<property name="hideTLS">
|
||||||
|
<value>${email.server.hideTLS}</value>
|
||||||
|
</property>
|
||||||
|
<property name="requireTLS">
|
||||||
|
<value>${email.server.requireTLS}</value>
|
||||||
|
</property>
|
||||||
<property name="emailService">
|
<property name="emailService">
|
||||||
<ref bean="EmailService" />
|
<ref bean="EmailService" />
|
||||||
</property>
|
</property>
|
||||||
|
@@ -3,12 +3,19 @@
|
|||||||
# - See the subsystem configuration for descriptions of the properties
|
# - See the subsystem configuration for descriptions of the properties
|
||||||
#
|
#
|
||||||
|
|
||||||
|
# User to use if there is no match to a person in alfresco
|
||||||
email.inbound.unknownUser=anonymous
|
email.inbound.unknownUser=anonymous
|
||||||
email.inbound.enabled=true
|
email.inbound.enabled=true
|
||||||
|
|
||||||
email.server.enabled=false
|
email.server.enabled=false
|
||||||
email.server.port=25
|
email.server.port=25
|
||||||
email.server.connections.max=3
|
email.server.connections.max=3
|
||||||
email.server.domain=alfresco.com
|
email.server.domain=alfresco.com
|
||||||
email.server.allowed.senders=.*
|
email.server.allowed.senders=.*
|
||||||
email.server.blocked.senders=
|
email.server.blocked.senders=
|
||||||
|
|
||||||
|
# Set this to true to accept TLS but not announce it when the EHLO is called.
|
||||||
|
email.server.hideTLS=false
|
||||||
|
# Set this to false to turn off TLS, The server will not allow TLS.
|
||||||
|
email.server.enableTLS=true
|
||||||
|
# Set this to true to require TLS
|
||||||
|
email.server.requireTLS=false
|
@@ -47,6 +47,9 @@ public abstract class EmailServer extends AbstractLifecycleBean
|
|||||||
private int maxConnections;
|
private int maxConnections;
|
||||||
private Set<String> blockedSenders;
|
private Set<String> blockedSenders;
|
||||||
private Set<String> allowedSenders;
|
private Set<String> allowedSenders;
|
||||||
|
private boolean hideTLS = false;
|
||||||
|
private boolean enableTLS = true;
|
||||||
|
private boolean requireTLS = false;
|
||||||
|
|
||||||
private EmailService emailService;
|
private EmailService emailService;
|
||||||
|
|
||||||
@@ -326,4 +329,38 @@ public abstract class EmailServer extends AbstractLifecycleBean
|
|||||||
System.err.println("\t configLocation - spring xml configs with EmailServer related beans (emailServer, emailServerConfiguration, emailService)");
|
System.err.println("\t configLocation - spring xml configs with EmailServer related beans (emailServer, emailServerConfiguration, emailService)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Hide the TLS (Trusted Login Session) option
|
||||||
|
*
|
||||||
|
* @param hideTLS
|
||||||
|
*/
|
||||||
|
public void setHideTLS(boolean hideTLS)
|
||||||
|
{
|
||||||
|
this.hideTLS = hideTLS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isHideTLS()
|
||||||
|
{
|
||||||
|
return hideTLS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setEnableTLS(boolean enableTLS)
|
||||||
|
{
|
||||||
|
this.enableTLS = enableTLS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isEnableTLS()
|
||||||
|
{
|
||||||
|
return enableTLS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setRequireTLS(boolean requireTLS)
|
||||||
|
{
|
||||||
|
this.requireTLS = requireTLS;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isRequireTLS()
|
||||||
|
{
|
||||||
|
return requireTLS;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -35,7 +35,6 @@ import org.subethamail.smtp.MessageHandlerFactory;
|
|||||||
import org.subethamail.smtp.RejectException;
|
import org.subethamail.smtp.RejectException;
|
||||||
import org.subethamail.smtp.TooMuchDataException;
|
import org.subethamail.smtp.TooMuchDataException;
|
||||||
import org.subethamail.smtp.server.SMTPServer;
|
import org.subethamail.smtp.server.SMTPServer;
|
||||||
import org.subethamail.smtp.server.io.DeferredFileOutputStream;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @since 2.2
|
* @since 2.2
|
||||||
@@ -58,6 +57,11 @@ public class SubethaEmailServer extends EmailServer
|
|||||||
serverImpl.setPort(getPort());
|
serverImpl.setPort(getPort());
|
||||||
serverImpl.setHostName(getDomain());
|
serverImpl.setHostName(getDomain());
|
||||||
serverImpl.setMaxConnections(getMaxConnections());
|
serverImpl.setMaxConnections(getMaxConnections());
|
||||||
|
|
||||||
|
serverImpl.setHideTLS(isHideTLS());
|
||||||
|
serverImpl.setEnableTLS(isEnableTLS());
|
||||||
|
serverImpl.setRequireTLS(isRequireTLS());
|
||||||
|
|
||||||
serverImpl.start();
|
serverImpl.start();
|
||||||
log.info("Inbound SMTP Email Server has started successfully, on hostName:" + getDomain() + "port:" + getPort());
|
log.info("Inbound SMTP Email Server has started successfully, on hostName:" + getDomain() + "port:" + getPort());
|
||||||
}
|
}
|
||||||
@@ -131,12 +135,12 @@ public class SubethaEmailServer extends EmailServer
|
|||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
// DH: As per comments in ETHREEOH-2252, I am very concerned about the need to do the clear() here.
|
// // DH: As per comments in ETHREEOH-2252, I am very concerned about the need to do the clear() here.
|
||||||
// If this message is stateful (as it must be, given the API) then the need to clear
|
// // If this message is stateful (as it must be, given the API) then the need to clear
|
||||||
// the list of delivery recipients ('deliveries') implies that Subetha is re-using
|
// // the list of delivery recipients ('deliveries') implies that Subetha is re-using
|
||||||
// the instance.
|
// // the instance.
|
||||||
// Later versions of Subetha appear to define the behaviour better. Un upgrade of
|
// // Later versions of Subetha appear to define the behaviour better. Un upgrade of
|
||||||
// the library would be a good idea.
|
// // the library would be a good idea.
|
||||||
deliveries.clear();
|
deliveries.clear();
|
||||||
}
|
}
|
||||||
// See ALFCOM-3165: Support multiple recipients for inbound Subetha email messages
|
// See ALFCOM-3165: Support multiple recipients for inbound Subetha email messages
|
||||||
@@ -210,6 +214,12 @@ public class SubethaEmailServer extends EmailServer
|
|||||||
public void resetState()
|
public void resetState()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void done()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
class Delivery
|
class Delivery
|
||||||
|
Reference in New Issue
Block a user