" + "Command: " + title + "\n
\n";
content += "
\n";
content += "";
content += "";
@@ -83,7 +93,7 @@ function createContentTextHtml(nodes)
content += "Url | ";
content += "Download Url | ";
content += "
";
- content += "\n"
+ content += "\n" + "";
for (var i = 0; i < nodes.length; i++)
@@ -133,7 +143,7 @@ function commandSearch(params)
if (query == null)
{
- createEmail(errorParameter, errorParameter, errorParameter, false);
+ createEmail(errorParameter, errorParameter, errorParameter);
return;
}
@@ -154,7 +164,7 @@ function commandSearch(params)
}
else
{
- createEmail(errorXPathNotValid, errorXPathNotValid, errorXPathNotValid, false);
+ createEmail(errorXPathNotValid, errorXPathNotValid, errorXPathNotValid);
return;
}
break;
@@ -180,8 +190,8 @@ function commandSearch(params)
createEmail(message, message, subject);
return;
}
- /*createEmail(createResponseTextHtml(nodes), createContentTextPlain(nodes), subject, true);*/
- createEmail(createContentTextHtml(nodes), createContentTextPlain(nodes), subject, false);
+ /*createEmail(createContentTextPlain(nodes), createResponseTextHtml(nodes), subject);*/
+ createEmail(createContentTextPlain(nodes), createContentTextHtml(nodes), subject);
}
/**
* Decode subject
@@ -224,13 +234,13 @@ function main()
else
{
var message = unknownCommand + ": '" + title + "'";
- createEmail(message, message, message, false);
+ createEmail(message, message, message);
}
}
else
{
var message = unknownCommand + ": '" + title + "'";
- createEmail(message, message, message, false);
+ createEmail(message, message, message);
}
document.remove();
diff --git a/config/alfresco/imap/scripts/command-utils.js b/config/alfresco/imap/scripts/command-utils.js
index 64039946f5..513c394127 100755
--- a/config/alfresco/imap/scripts/command-utils.js
+++ b/config/alfresco/imap/scripts/command-utils.js
@@ -1,9 +1,8 @@
/**
* Create e-mail
-* contentTextHtml (string) html content
-* contentTextPlain (string) text content
+* contentEML (string) content message
*/
-function createEmail(contentTextHtml, contentTextPlain, subject, templateUsed)
+function createEmail(messageTXT, messageHTML, subject)
{
var command = document.properties["cm:title"];
var userName = person.properties["cm:userName"];
@@ -15,42 +14,42 @@ function createEmail(contentTextHtml, contentTextPlain, subject, templateUsed)
return;
}
- var nextMessageUID = inboxFolder.properties["imap:nextMessageUID"];
- inboxFolder.properties["imap:nextMessageUID"] = nextMessageUID + 1;
- inboxFolder.save();
-
- var response = inboxFolder.createNode("response" + Date.now(), "imap:imapContent");
+ var response = inboxFolder.createNode("response" + Date.now() + ".eml", "cm:content");
response.properties["imap:messageFrom"] = "command@alfresco.com";
response.properties["imap:messageSubject"] = subject;
response.properties["imap:messageTo"] = document.properties["cm:originator"];
response.properties["imap:messageCc"] = "";
- response.properties["imap:messageUID"] = nextMessageUID;
+ response.addAspect("imap:imapContent", null);
+ response.content = createRFC822Message("command@alfresco.com", document.properties["cm:originator"], subject, messageTXT, messageHTML);
response.save();
-
- var textBody = response.createNode("Body.txt", "imap:imapBody");
- textBody.content = contentTextPlain;
- textBody.save();
-
- var htmlBody = response.createNode("Body.html", "imap:imapBody");
- if (templateUsed == true)
- {
- htmlBody.content = contentTextHtml;
}
- else
- {
- htmlBody.content = "" +
- "" +
- "" +
- "" +
- "" +
- "" +
- "" + contentTextHtml + "
";
- }
- htmlBody.save();
+function createRFC822Message(from, to, subject, textPart, htmlPart)
+{
+ var id = new Number(Date.now()).toString(16);
+ var boundary = "----------" + id;
+ var date = new Date().toGMTString();
+ var messageHeaders = "MIME-Version: 1.0\r\n" +
+ "Date: " + date + "\r\n" +
+ "From: " + from + "\r\n" +
+ "To: " + to + "\r\n" +
+ "Subject: " + subject + "\r\n" +
+ "Message-ID: " + id + "\r\n" +
+ "X-Priority: 3 (Normal)\r\n" +
+ "Content-Type: multipart/alternative; boundary=\"" + boundary + "\"\r\n\r\n";
+ var messageBody = "";
+ messageBody += messageHeaders;
+ messageBody += "--" + boundary + "\r\n";
+ messageBody += "Content-Type: text/plain; charset=utf-8\r\n";
+ //TODO Content-Transfer-Encoding
+ messageBody += "\r\n";
+ messageBody += textPart + "\r\n\r\n";
+ messageBody += "--" + boundary + "\r\n";
+ messageBody += "Content-Type: text/html; charset=utf-8\r\n";
+ //TODO Content-Transfer-Encoding
+ messageBody += "\r\n";
+ messageBody += htmlPart + "\r\n\r\n";
+ messageBody += "--" + boundary + "--\r\n\r\n";
+ return messageBody;
}
\ No newline at end of file
diff --git a/config/alfresco/messages/imap-service.properties b/config/alfresco/messages/imap-service.properties
index fdfd12856a..4eeec7fd8e 100755
--- a/config/alfresco/messages/imap-service.properties
+++ b/config/alfresco/messages/imap-service.properties
@@ -7,4 +7,8 @@ imap.server.info.message_body_not_found = "The message body parts are not found.
# Error messages. prefix 'imap.server.error'
imap.server.error.properties_dont_exist = "Appropriate properties do not exist."
+imap.server.error.permission_denied = "Cannot create folder - Permission denied."
+imap.server.error.folder_already_exist = "Folder already exists."
+imap.server.error.mailbox_name_is_mandatory = "Mailbox name is mandatory parameter."
+imap.server.error.cannot_get_a_folder = "Cannot get a folder with name ''{0}''."
diff --git a/config/alfresco/mimetype/mimetype-map.xml b/config/alfresco/mimetype/mimetype-map.xml
index 1e63fbff57..7837cb7214 100644
--- a/config/alfresco/mimetype/mimetype-map.xml
+++ b/config/alfresco/mimetype/mimetype-map.xml
@@ -353,6 +353,9 @@
dwt
+ eml
+
+
msg
diff --git a/config/alfresco/model/imapModel.xml b/config/alfresco/model/imapModel.xml
index ee93e810b2..f52ee75b8e 100755
--- a/config/alfresco/model/imapModel.xml
+++ b/config/alfresco/model/imapModel.xml
@@ -19,7 +19,7 @@
IMAP Folder
cm:folder
-
+
d:boolean
@@ -30,29 +30,6 @@
-
- IMAP File
- cm:folder
-
-
-
- d:text
-
-
- d:text
-
-
- d:text
-
-
- d:text
-
-
-
- imap:flaggable
-
-
-
Attachment to the IMAP message
cm:content
@@ -69,11 +46,63 @@
-
-
-
+
+
+ IMAP File
+ imap:flaggable
+
+
+
+ d:text
+
+
+ d:text
+
+
+ d:text
+
+
+ d:text
+
+
+ d:text
+
+
+ d:text
+
+
+
+
+ Attachment
+
+ false
+ false
+
+
+ cm:cmobject
+ false
+ true
+
+
+
+ Attachments Folder
+
+ false
+ false
+
+
+ cm:cmobject
+ false
+ false
+
+
+
+
+
+
+
- d:boolean
+ d:boolean
d:boolean
@@ -90,11 +119,10 @@
d:boolean
-
-
-
-
+
+
+
\ No newline at end of file
diff --git a/config/alfresco/patch/patch-services-context.xml b/config/alfresco/patch/patch-services-context.xml
index 9c25c30fda..e141bf8f53 100644
--- a/config/alfresco/patch/patch-services-context.xml
+++ b/config/alfresco/patch/patch-services-context.xml
@@ -1808,4 +1808,40 @@
+
+ patch.imapFolders
+ patch.imapFolders.description
+ 0
+ 2012
+ 2013
+
+
+
+
+
+
+
+
+
+ alfresco/templates/imap/imap_config_space.acp
+ alfresco/templates/imap/email_actions_space.acp
+ alfresco/templates/imap/command_processor_scripts.acp
+
+
+
+ patch.imapUserFolders
+ patch.imapUserFolders.description
+ 0
+ 2012
+ 2013
+
+
+
+
+
+
+
+
+
+
diff --git a/config/alfresco/repository.properties b/config/alfresco/repository.properties
index efc9ddd4c0..1dbf8cfb7b 100644
--- a/config/alfresco/repository.properties
+++ b/config/alfresco/repository.properties
@@ -338,14 +338,22 @@ nfs.user.mappings.default.gid=0
# IMAP
imap.server.enabled=false
imap.server.port=143
+imap.server.host=localhost
+imap.server.attachments.extraction.enabled=true
# Default IMAP mount points
-imap.server.mountPoints=Repository_virtual,Repository_archive
+imap.server.mountPoints=Repository_virtual,Repository_archive,Repository_mixed
imap.server.mountPoints.default.store=${spaces.store}
imap.server.mountPoints.default.rootPath=/${spaces.company_home.childname}
imap.server.mountPoints.default.mode=virtual
imap.server.mountPoints.value.Repository_virtual.mode=virtual
imap.server.mountPoints.value.Repository_archive.mode=archive
+imap.server.mountPoints.value.Repository_mixed.mode=mixed
+
+# Folders that will be excluded from the automatic extraction capability
+#imap.ignore.extraction=adminInbox
+#imap.ignore.extraction.value.adminInbox.store=${spaces.store}
+#imap.ignore.extraction.value.adminInbox.rootPath=/${spaces.company_home.childname}/imap:imap_home/cm:admin/cm:INBOX
# Activity feed max size and max age (eg. 44640 mins = 31 days)
activities.feed.max.size=100
diff --git a/config/alfresco/subsystems/imap/default/imap-server-context.xml b/config/alfresco/subsystems/imap/default/imap-server-context.xml
index 471428e36c..3e39ce89db 100755
--- a/config/alfresco/subsystems/imap/default/imap-server-context.xml
+++ b/config/alfresco/subsystems/imap/default/imap-server-context.xml
@@ -11,41 +11,10 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- ${mail.from.default}
-
-
-
- ${web.application.context.url}
-
-
-
- ${spaces.store}/${spaces.company_home.childname}/${spaces.imap_home.childname}
-
-
-
- ${spaces.store}/${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.imapConfig.childname}/${spaces.imap_templates.childname}
-
-
-
+
+ ${imap.server.host}
+
${imap.server.port}
@@ -58,16 +27,13 @@
-
-
-
-
+
virtual
@@ -78,7 +44,7 @@
/${spaces.company_home.childname}
-
+
archive
@@ -93,17 +59,101 @@
+
+
+
+
+
+
+
+
+
+ ${server.transaction.mode.readOnly}
+ ${server.transaction.mode.default}
+ ${server.transaction.mode.default}
+ ${server.transaction.mode.readOnly}
+ ${server.transaction.mode.default}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ${spaces.store}/${spaces.company_home.childname}/${spaces.imap_home.childname}
+
+
+ ${mail.from.default}
+
+
+ ${web.application.context.url}
+
+
+ ${spaces.store}/${spaces.company_home.childname}/${spaces.dictionary.childname}/${spaces.imapConfig.childname}/${spaces.imap_templates.childname}
+
+
+ ${imap.server.attachments.extraction.enabled}
+
+
+
+
+
+
+
+
+ org.alfresco.repo.imap.ImapService
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
-
-
-
diff --git a/config/alfresco/subsystems/imap/default/imap-server.properties b/config/alfresco/subsystems/imap/default/imap-server.properties
index 42d301e12e..d7b69af91e 100755
--- a/config/alfresco/subsystems/imap/default/imap-server.properties
+++ b/config/alfresco/subsystems/imap/default/imap-server.properties
@@ -1,4 +1,5 @@
imap.server.enabled=false
+imap.server.host=localhost
imap.server.port=143
#imap.server.web.application.context.url=http://localhost:8080/alfresco
diff --git a/config/alfresco/templates/imap/command_processor_scripts.acp b/config/alfresco/templates/imap/command_processor_scripts.acp
index dda4f430b3..9ed2769b74 100755
Binary files a/config/alfresco/templates/imap/command_processor_scripts.acp and b/config/alfresco/templates/imap/command_processor_scripts.acp differ
diff --git a/config/alfresco/templates/imap/imap_config_space.acp b/config/alfresco/templates/imap/imap_config_space.acp
index d2dee2323c..31b4c744ee 100755
Binary files a/config/alfresco/templates/imap/imap_config_space.acp and b/config/alfresco/templates/imap/imap_config_space.acp differ
diff --git a/config/alfresco/templates/imap/imap_message_text_html.ftl b/config/alfresco/templates/imap/imap_message_text_html.ftl
index 5af0c44148..41c0433af7 100755
--- a/config/alfresco/templates/imap/imap_message_text_html.ftl
+++ b/config/alfresco/templates/imap/imap_message_text_html.ftl
@@ -84,7 +84,7 @@