mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
EmailServer code.
- This is not fully integrated. In fact, the integration points have been disabled. - The main code for now is the remote stream. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6756 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -19,6 +19,7 @@
|
||||
<import resource="classpath:alfresco/node-services-context.xml" />
|
||||
<import resource="classpath:alfresco/scheduled-jobs-context.xml" />
|
||||
<import resource="classpath:alfresco/network-protocol-context.xml" />
|
||||
<import resource="classpath:alfresco/email-service-context.xml" />
|
||||
<import resource="classpath:alfresco/content-services-context.xml" />
|
||||
<import resource="classpath:alfresco/hibernate-context.xml" />
|
||||
<import resource="classpath:alfresco/ownable-services-context.xml" />
|
||||
|
@@ -429,5 +429,14 @@
|
||||
<bean id="workflowScheduler" class="org.alfresco.repo.workflow.jbpm.JBPMScheduler">
|
||||
<property name="JBPMTemplate" ref="jbpm_template" />
|
||||
</bean>
|
||||
|
||||
<!-- Email Server -->
|
||||
<!--
|
||||
<bean id="emailServer" class="org.alfresco.email.server.impl.subetha.SubethaEmailServer">
|
||||
<constructor-arg>
|
||||
<ref bean="emailServerConfiguration"/>
|
||||
</constructor-arg>
|
||||
</bean>
|
||||
-->
|
||||
|
||||
</beans>
|
||||
|
29
config/alfresco/bootstrap/emailServer.xml
Normal file
29
config/alfresco/bootstrap/emailServer.xml
Normal file
@@ -0,0 +1,29 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<view:view
|
||||
xmlns:view="http://www.alfresco.org/view/repository/1.0"
|
||||
xmlns:cm="http://www.alfresco.org/model/content/1.0"
|
||||
xmlns:sys="http://www.alfresco.org/model/system/1.0"
|
||||
xmlns:usr="http://www.alfresco.org/model/user/1.0"
|
||||
xmlns:app="http://www.alfresco.org/model/application/1.0">
|
||||
|
||||
<usr:authorityContainer view:childName="usr:GROUP_EMAIL_CONTRIBUTORS">
|
||||
<view:aspects>
|
||||
<sys:referenceable></sys:referenceable>
|
||||
</view:aspects>
|
||||
<view:properties>
|
||||
<sys:store-protocol>user</sys:store-protocol>
|
||||
<sys:store-identifier>alfrescoUserStore</sys:store-identifier>
|
||||
<usr:members>
|
||||
<view:values>
|
||||
<view:value>admin</view:value>
|
||||
<view:value view:isNull="true"></view:value>
|
||||
</view:values>
|
||||
</usr:members>
|
||||
<cm:name>GROUP_EMAIL_CONTRIBUTORS</cm:name>
|
||||
<sys:node-uuid>GROUP_EMAIL_CONTRIBUTORS</sys:node-uuid>
|
||||
<usr:authorityName>GROUP_EMAIL_CONTRIBUTORS</usr:authorityName>
|
||||
</view:properties>
|
||||
<view:associations></view:associations>
|
||||
</usr:authorityContainer>
|
||||
|
||||
</view:view>
|
@@ -685,6 +685,9 @@
|
||||
<value>org/alfresco/repo/rule/ruleModel.xml</value>
|
||||
<value>org/alfresco/repo/version/version_model.xml</value>
|
||||
|
||||
<!-- Email model -->
|
||||
<value>alfresco/model/emailServerModel.xml</value>
|
||||
|
||||
<!-- Deprecated types -->
|
||||
<value>alfresco/model/deprecated/deprecated_contentModel.xml</value>
|
||||
</list>
|
||||
|
6
config/alfresco/email-server.properties
Normal file
6
config/alfresco/email-server.properties
Normal file
@@ -0,0 +1,6 @@
|
||||
mail.inbound.enabled=false
|
||||
email.server.enabled=false
|
||||
email.server.port=25
|
||||
email.server.domain=alfresco.com
|
||||
email.server.allowed.senders=
|
||||
email.server.blocked.senders=
|
166
config/alfresco/email-service-context.xml
Normal file
166
config/alfresco/email-service-context.xml
Normal file
@@ -0,0 +1,166 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
|
||||
|
||||
<beans>
|
||||
|
||||
<!-- I18N -->
|
||||
|
||||
<bean id="emailResourceBundles" class="org.alfresco.i18n.ResourceBundleBootstrapComponent">
|
||||
<property name="resourceBundles">
|
||||
<list>
|
||||
<value>alfresco.messages.email-service</value>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
|
||||
<bean id="emailServerConfigurationProperties" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
||||
<property name="ignoreUnresolvablePlaceholders">
|
||||
<value>true</value>
|
||||
</property>
|
||||
<property name="locations">
|
||||
<list>
|
||||
<value>classpath:alfresco/email-server.properties</value>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="emailServerConfiguration" class="org.alfresco.email.server.EmailServerConfiguration">
|
||||
|
||||
<property name="domain">
|
||||
<value>${email.server.domain}</value>
|
||||
</property>
|
||||
|
||||
<property name="port">
|
||||
<value>${email.server.port}</value>
|
||||
</property>
|
||||
|
||||
<property name="enabled">
|
||||
<value>${email.server.enabled}</value>
|
||||
</property>
|
||||
|
||||
<property name="blockedSenders">
|
||||
<value>${email.server.blocked.senders}</value>
|
||||
</property>
|
||||
|
||||
<property name="allowedSenders">
|
||||
<value>${email.server.allowed.senders}</value>
|
||||
</property>
|
||||
|
||||
<property name="emailService">
|
||||
<ref bean="emailService" />
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean class="org.springframework.remoting.rmi.RmiServiceExporter">
|
||||
<property name="service">
|
||||
<ref bean="emailService"/>
|
||||
</property>
|
||||
<property name="serviceInterface">
|
||||
<value>org.alfresco.service.cmr.email.EmailService</value>
|
||||
</property>
|
||||
<property name="serviceName">
|
||||
<value>emailService</value>
|
||||
</property>
|
||||
<property name="registryPort">
|
||||
<value>${avm.remote.port}</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="emailService" class="org.alfresco.email.server.EmailServiceImpl">
|
||||
|
||||
<property name="mailInboundEnabled">
|
||||
<value>${mail.inbound.enabled}</value>
|
||||
</property>
|
||||
|
||||
<property name="unknownUser" value="admin" />
|
||||
|
||||
<property name="emailMessageHandlerMap">
|
||||
<map>
|
||||
<entry key="folder">
|
||||
<ref bean="folderEmailMessageHandler"></ref>
|
||||
</entry>
|
||||
<entry key="forum">
|
||||
<ref bean="forumEmailMessageHandler"></ref>
|
||||
</entry>
|
||||
<entry key="discussion">
|
||||
<ref bean="forumEmailMessageHandler"></ref>
|
||||
</entry>
|
||||
<entry key="topic">
|
||||
<ref bean="topicEmailMessageHandler"></ref>
|
||||
</entry>
|
||||
<entry key="post">
|
||||
<ref bean="topicEmailMessageHandler"></ref>
|
||||
</entry>
|
||||
<entry key="content">
|
||||
<ref bean="documentEmailMessageHandler"></ref>
|
||||
</entry>
|
||||
</map>
|
||||
</property>
|
||||
|
||||
<property name="nodeService">
|
||||
<ref bean="nodeService" />
|
||||
</property>
|
||||
<property name="searchService">
|
||||
<ref bean="searchService" />
|
||||
</property>
|
||||
|
||||
<property name="retryingTransactionHelper">
|
||||
<ref bean="retryingTransactionHelper" />
|
||||
</property>
|
||||
|
||||
</bean>
|
||||
|
||||
<bean id="folderEmailMessageHandler"
|
||||
parent="emailMessageHandlerBase"
|
||||
class="org.alfresco.email.server.handler.FolderEmailMessageHandler" />
|
||||
|
||||
<bean id="forumEmailMessageHandler"
|
||||
parent="emailMessageHandlerBase"
|
||||
class="org.alfresco.email.server.handler.ForumEmailMessageHandler" />
|
||||
|
||||
<bean id="documentEmailMessageHandler"
|
||||
parent="emailMessageHandlerBase"
|
||||
class="org.alfresco.email.server.handler.DocumentEmailMessageHandler" />
|
||||
|
||||
<bean id="topicEmailMessageHandler"
|
||||
parent="emailMessageHandlerBase"
|
||||
class="org.alfresco.email.server.handler.TopicEmailMessageHandler" />
|
||||
|
||||
<bean id="emailMessageHandlerBase" abstract="true">
|
||||
<property name="authenticationService">
|
||||
<ref bean="authenticationService" />
|
||||
</property>
|
||||
<property name="authenticationComponent">
|
||||
<ref bean="authenticationComponent" />
|
||||
</property>
|
||||
<property name="nodeService">
|
||||
<ref bean="nodeService" />
|
||||
</property>
|
||||
<property name="personService">
|
||||
<ref bean="personService" />
|
||||
</property>
|
||||
<property name="searchService">
|
||||
<ref bean="searchService" />
|
||||
</property>
|
||||
<property name="contentService">
|
||||
<ref bean="contentService" />
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<bean id="alisableAspect"
|
||||
class="org.alfresco.email.server.AliasableAspect"
|
||||
init-method="initialise">
|
||||
<property name="nodeService">
|
||||
<ref bean="nodeService" />
|
||||
</property>
|
||||
<property name="searchService">
|
||||
<ref bean="searchService" />
|
||||
</property>
|
||||
<property name="policyComponent">
|
||||
<ref bean="policyComponent" />
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
|
||||
</beans>
|
@@ -0,0 +1,26 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
|
||||
|
||||
<!--
|
||||
An example of how to override the emailServerConfiguration.
|
||||
For example you can change port or domain or others property.
|
||||
So here we substituted port to 2525 and added blocked senders from *.tut.by.
|
||||
Also we turn on email server (set enabled property to true).
|
||||
-->
|
||||
<beans>
|
||||
|
||||
<bean id="emailServerConfigurationProperties" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
||||
<property name="ignoreUnresolvablePlaceholders">
|
||||
<value>true</value>
|
||||
</property>
|
||||
<property name="locations">
|
||||
<list>
|
||||
<value>classpath:alfresco/email-server.properties</value>
|
||||
|
||||
<!-- Override -->
|
||||
<value>classpath:alfresco/extension/custom-email-server.properties</value>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
</beans>
|
17
config/alfresco/messages/email-service.properties
Normal file
17
config/alfresco/messages/email-service.properties
Normal file
@@ -0,0 +1,17 @@
|
||||
email.server.denied-address="Address {0} is in black list"
|
||||
email.server.not-white-address="Address {0} is not in white list"
|
||||
email.server.incorrect-node-ref="Incorrect node ref"
|
||||
email.server.incorrect-node-address="Incorrect node address"
|
||||
email.server.incorrect-node-type="Incorrect node type"
|
||||
email.server.handler-not-found="Hanlder wasn't found"
|
||||
email.server.unknown-user="Unknown user is not in email contribute group"
|
||||
email.server.not-contribute-user="User {0} is not in contribute group"
|
||||
email.server.contribute-group-not-exist="Email contribute group is not created"
|
||||
email.server.content-error="Content error"
|
||||
email.server.incorrect-message-part="Incorrect message part"
|
||||
email.server.error-getting-message-content="Couldn't get message part content"
|
||||
email.server.error-getting-content-stream="Couldn't get stream of the message part content"
|
||||
email.server.error-creating-message="Couldn't create MIME message from input stream"
|
||||
email.server.error-parse-message="Couldn't parse the message"
|
||||
email.server.mail-inbound-disabled="Email behaviour to be disabled completely on the server"
|
||||
email.server.usupported-encoding="Encoding {0} is not support"
|
65
config/alfresco/model/emailServerModel.xml
Normal file
65
config/alfresco/model/emailServerModel.xml
Normal file
@@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<model name="emailserver:emailserverModel"
|
||||
xmlns="http://www.alfresco.org/model/dictionary/1.0">
|
||||
|
||||
<!-- Optional meta-data about the model -->
|
||||
<description>Emailserver Model</description>
|
||||
<author>UTL</author>
|
||||
<version>1.0</version>
|
||||
|
||||
<!-- Imports are required to allow references to definitions in other models -->
|
||||
<imports>
|
||||
<!-- Import Alfresco Dictionary Definitions -->
|
||||
<import uri="http://www.alfresco.org/model/dictionary/1.0"
|
||||
prefix="d" />
|
||||
<!-- Import Alfresco Content Domain Model Definitions -->
|
||||
<import uri="http://www.alfresco.org/model/content/1.0"
|
||||
prefix="cm" />
|
||||
</imports>
|
||||
|
||||
<!-- Introduction of new namespaces defined by this model -->
|
||||
<!-- NOTE: The following namespace my.new.model should be changed to reflect your own namespace -->
|
||||
<namespaces>
|
||||
<namespace uri="http://www.alfresco.org/model/emailserver/1.0"
|
||||
prefix="emailserver" />
|
||||
</namespaces>
|
||||
|
||||
<aspects>
|
||||
|
||||
<aspect name="emailserver:attached">
|
||||
<title>Attached</title>
|
||||
<associations>
|
||||
<association name="emailserver:attachment">
|
||||
<title>Attachment</title>
|
||||
<source>
|
||||
<mandatory>true</mandatory>
|
||||
<many>true</many>
|
||||
</source>
|
||||
<target>
|
||||
<class>cm:content</class>
|
||||
<mandatory>false</mandatory>
|
||||
<many>false</many>
|
||||
</target>
|
||||
</association>
|
||||
</associations>
|
||||
</aspect>
|
||||
|
||||
<aspect name="emailserver:emailed">
|
||||
<title>Emailed</title>
|
||||
<parent>cm:emailed</parent>
|
||||
</aspect>
|
||||
|
||||
<aspect name="emailserver:aliasable">
|
||||
<title>Aliasable</title>
|
||||
<properties>
|
||||
<property name="emailserver:alias">
|
||||
<title>Alias</title>
|
||||
<type>d:text</type>
|
||||
<mandatory>true</mandatory>
|
||||
</property>
|
||||
</properties>
|
||||
</aspect>
|
||||
|
||||
</aspects>
|
||||
</model>
|
28
config/alfresco/remote-email-service-test-context.xml
Normal file
28
config/alfresco/remote-email-service-test-context.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
|
||||
|
||||
<beans>
|
||||
|
||||
<bean id="remoteEmailServiceProperties"
|
||||
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
|
||||
<property name="ignoreUnresolvablePlaceholders">
|
||||
<value>true</value>
|
||||
</property>
|
||||
<property name="locations">
|
||||
<list>
|
||||
<value>classpath:alfresco/remote-email-service-test.properties</value>
|
||||
</list>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
<!-- Remote email-service. -->
|
||||
<bean id="emailService" class="org.alfresco.email.server.EmailServiceRemotable">
|
||||
<property name="rmiRegistryHost">
|
||||
<value>${email.service.rmi.registry.host}</value>
|
||||
</property>
|
||||
<property name="rmiRegistryPort">
|
||||
<value>${email.service.rmi.registry.port}</value>
|
||||
</property>
|
||||
</bean>
|
||||
|
||||
</beans>
|
Reference in New Issue
Block a user