" + "Command: " + title + "\n
\n";
+ var content = "Command: " + title + "\n
\n";
content += "
\n";
content += "";
content += "";
@@ -93,7 +83,7 @@ function createContentTextHtml(nodes)
content += "Url | ";
content += "Download Url | ";
content += "
";
- content += "\n" + "";
+ content += "\n"
for (var i = 0; i < nodes.length; i++)
@@ -143,7 +133,7 @@ function commandSearch(params)
if (query == null)
{
- createEmail(errorParameter, errorParameter, errorParameter);
+ createEmail(errorParameter, errorParameter, errorParameter, false);
return;
}
@@ -164,7 +154,7 @@ function commandSearch(params)
}
else
{
- createEmail(errorXPathNotValid, errorXPathNotValid, errorXPathNotValid);
+ createEmail(errorXPathNotValid, errorXPathNotValid, errorXPathNotValid, false);
return;
}
break;
@@ -190,8 +180,8 @@ function commandSearch(params)
createEmail(message, message, subject);
return;
}
- /*createEmail(createContentTextPlain(nodes), createResponseTextHtml(nodes), subject);*/
- createEmail(createContentTextPlain(nodes), createContentTextHtml(nodes), subject);
+ /*createEmail(createResponseTextHtml(nodes), createContentTextPlain(nodes), subject, true);*/
+ createEmail(createContentTextHtml(nodes), createContentTextPlain(nodes), subject, false);
}
/**
* Decode subject
@@ -234,13 +224,13 @@ function main()
else
{
var message = unknownCommand + ": '" + title + "'";
- createEmail(message, message, message);
+ createEmail(message, message, message, false);
}
}
else
{
var message = unknownCommand + ": '" + title + "'";
- createEmail(message, message, message);
+ createEmail(message, message, message, false);
}
document.remove();
diff --git a/config/alfresco/imap/scripts/command-utils.js b/config/alfresco/imap/scripts/command-utils.js
index 513c394127..64039946f5 100755
--- a/config/alfresco/imap/scripts/command-utils.js
+++ b/config/alfresco/imap/scripts/command-utils.js
@@ -1,8 +1,9 @@
/**
* Create e-mail
-* contentEML (string) content message
+* contentTextHtml (string) html content
+* contentTextPlain (string) text content
*/
-function createEmail(messageTXT, messageHTML, subject)
+function createEmail(contentTextHtml, contentTextPlain, subject, templateUsed)
{
var command = document.properties["cm:title"];
var userName = person.properties["cm:userName"];
@@ -14,42 +15,42 @@ function createEmail(messageTXT, messageHTML, subject)
return;
}
- var response = inboxFolder.createNode("response" + Date.now() + ".eml", "cm:content");
+ var nextMessageUID = inboxFolder.properties["imap:nextMessageUID"];
+ inboxFolder.properties["imap:nextMessageUID"] = nextMessageUID + 1;
+ inboxFolder.save();
+
+ var response = inboxFolder.createNode("response" + Date.now(), "imap:imapContent");
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.addAspect("imap:imapContent", null);
+ response.properties["imap:messageUID"] = nextMessageUID;
- response.content = createRFC822Message("command@alfresco.com", document.properties["cm:originator"], subject, messageTXT, messageHTML);
response.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;
+ 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();
+
}
\ No newline at end of file
diff --git a/config/alfresco/messages/imap-service.properties b/config/alfresco/messages/imap-service.properties
index 4eeec7fd8e..fdfd12856a 100755
--- a/config/alfresco/messages/imap-service.properties
+++ b/config/alfresco/messages/imap-service.properties
@@ -7,8 +7,4 @@ 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 7837cb7214..1e63fbff57 100644
--- a/config/alfresco/mimetype/mimetype-map.xml
+++ b/config/alfresco/mimetype/mimetype-map.xml
@@ -353,9 +353,6 @@
dwt
- eml
-
-
msg
diff --git a/config/alfresco/model/imapModel.xml b/config/alfresco/model/imapModel.xml
index f52ee75b8e..ee93e810b2 100755
--- a/config/alfresco/model/imapModel.xml
+++ b/config/alfresco/model/imapModel.xml
@@ -19,7 +19,7 @@
IMAP Folder
cm:folder
-
+
d:boolean
@@ -30,6 +30,29 @@
+
+ IMAP File
+ cm:folder
+
+
+
+ d:text
+
+
+ d:text
+
+
+ d:text
+
+
+ d:text
+
+
+
+ imap:flaggable
+
+
+
Attachment to the IMAP message
cm:content
@@ -46,63 +69,11 @@
-
-
- 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
@@ -119,10 +90,11 @@
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 e141bf8f53..9c25c30fda 100644
--- a/config/alfresco/patch/patch-services-context.xml
+++ b/config/alfresco/patch/patch-services-context.xml
@@ -1808,40 +1808,4 @@
-
- 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 1dbf8cfb7b..efc9ddd4c0 100644
--- a/config/alfresco/repository.properties
+++ b/config/alfresco/repository.properties
@@ -338,22 +338,14 @@ 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,Repository_mixed
+imap.server.mountPoints=Repository_virtual,Repository_archive
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 3e39ce89db..471428e36c 100755
--- a/config/alfresco/subsystems/imap/default/imap-server-context.xml
+++ b/config/alfresco/subsystems/imap/default/imap-server-context.xml
@@ -11,10 +11,41 @@
-
-
- ${imap.server.host}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ${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.port}
@@ -27,13 +58,16 @@
+
+
+
-
+
virtual
@@ -44,7 +78,7 @@
/${spaces.company_home.childname}
-
+
archive
@@ -59,101 +93,17 @@
-
-
-
-
-
-
-
-
-
- ${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 d7b69af91e..42d301e12e 100755
--- a/config/alfresco/subsystems/imap/default/imap-server.properties
+++ b/config/alfresco/subsystems/imap/default/imap-server.properties
@@ -1,5 +1,4 @@
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 9ed2769b74..dda4f430b3 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 31b4c744ee..d2dee2323c 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 41c0433af7..5af0c44148 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 @@