From e47bc8cb1b19623da58b54ae8aeef46a97060f7d Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Tue, 16 Feb 2016 19:08:12 -0500 Subject: [PATCH 1/3] (fix) fixed missing includes in tool --- Tests/Integration/teststrings.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Tests/Integration/teststrings.m b/Tests/Integration/teststrings.m index 94f98c3a7..0e5bdd0c8 100644 --- a/Tests/Integration/teststrings.m +++ b/Tests/Integration/teststrings.m @@ -20,8 +20,12 @@ * Boston, MA 02111-1307, USA. */ +#include +#include +#include +#include -#import +#include static int performTest (char *filename) From 1f71cff18d4a9f845ec9c5e9691836ed1a4a8f8f Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Wed, 17 Feb 2016 08:24:32 -0500 Subject: [PATCH 2/3] (feat) you can now limit the file upload size using WOMaxUploadSize --- NEWS | 2 ++ UI/MailerUI/English.lproj/Localizable.strings | 3 +++ UI/MailerUI/UIxMailEditor.m | 6 ++++++ UI/WebServerResources/js/Mailer/MessageEditorController.js | 6 ++++++ 4 files changed, 17 insertions(+) diff --git a/NEWS b/NEWS index 80aa5b1c1..8d4d2e018 100644 --- a/NEWS +++ b/NEWS @@ -5,6 +5,8 @@ New features - [web] show all/only this calendar - [web] convert a message to an appointment or a task (#1722) - [web] customizable base font size for HTML messages + - [web you can now limit the file upload size using the WOMaxUploadSize + configuration parameter (integer value in kilobytes) (#3510, #3135) Enhancements - [web] added Junk handling feature from v2 diff --git a/UI/MailerUI/English.lproj/Localizable.strings b/UI/MailerUI/English.lproj/Localizable.strings index b98565fb2..370a4a8ee 100644 --- a/UI/MailerUI/English.lproj/Localizable.strings +++ b/UI/MailerUI/English.lproj/Localizable.strings @@ -303,3 +303,6 @@ "Your email has been saved" = "Your email has been saved"; "Your email has been sent" = "Your email has been sent"; "Folder compacted" = "Folder compacted"; + +/* Error when uploading a file attachment */ +"An error occured while uploading" = "An error occured while uploading"; diff --git a/UI/MailerUI/UIxMailEditor.m b/UI/MailerUI/UIxMailEditor.m index dcce99e27..bc372eb7b 100644 --- a/UI/MailerUI/UIxMailEditor.m +++ b/UI/MailerUI/UIxMailEditor.m @@ -590,6 +590,12 @@ static NSArray *infoKeys = nil; request = [context request]; httpBody = [[request httpRequest] body]; + + // We got an exception from SOPE - most likely due to + // WOMaxUploadSize being reached. + if ([httpBody isKindOfClass: [NSException class]]) + return httpBody; + filenames = [self _scanAttachmentFilenamesInRequest: httpBody]; co = [self clientObject]; diff --git a/UI/WebServerResources/js/Mailer/MessageEditorController.js b/UI/WebServerResources/js/Mailer/MessageEditorController.js index d6b3e4813..2c49399a5 100644 --- a/UI/WebServerResources/js/Mailer/MessageEditorController.js +++ b/UI/WebServerResources/js/Mailer/MessageEditorController.js @@ -44,6 +44,12 @@ this.removeFromQueue(item); }, onErrorItem: function(item, response, status, headers) { + $mdToast.show( + $mdToast.simple() + .content(l('An error occured while uploading' + ' ' + item.file.name)) + .position('top right') + .hideDelay(3000)); + this.removeFromQueue(item); //console.debug(item); console.debug('error = ' + JSON.stringify(response, undefined, 2)); } }); From 4cd0c501bd8a185858b44862c77d4146e5cd3f93 Mon Sep 17 00:00:00 2001 From: Ludovic Marcotte Date: Wed, 17 Feb 2016 08:40:57 -0500 Subject: [PATCH 3/3] (fix) make use of existing string --- UI/MailerUI/English.lproj/Localizable.strings | 8 ++++---- .../js/Mailer/MessageEditorController.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/UI/MailerUI/English.lproj/Localizable.strings b/UI/MailerUI/English.lproj/Localizable.strings index 370a4a8ee..3a1f38498 100644 --- a/UI/MailerUI/English.lproj/Localizable.strings +++ b/UI/MailerUI/English.lproj/Localizable.strings @@ -260,8 +260,11 @@ "error_missingrecipients" = "Please specify at least one recipient."; "Send Anyway" = "Send Anyway"; "Error while saving the draft" = "Error while saving the draft"; + +/* Error when uploading a file attachment */ "Error while uploading the file \"%{0}\":" = "Error while uploading the file \"%{0}\":"; "There is an active file upload. Closing the window will interrupt it." = "There is an active file upload. Closing the window will interrupt it."; + /* Message sending */ "cannot send message: (smtp) all recipients discarded" = "Cannot send message: all recipients are invalid."; "cannot send message (smtp) - recipients discarded" = "Cannot send message. The following addresses are invalid"; @@ -302,7 +305,4 @@ "More search options" = "More search options"; "Your email has been saved" = "Your email has been saved"; "Your email has been sent" = "Your email has been sent"; -"Folder compacted" = "Folder compacted"; - -/* Error when uploading a file attachment */ -"An error occured while uploading" = "An error occured while uploading"; +"Folder compacted" = "Folder compacted"; \ No newline at end of file diff --git a/UI/WebServerResources/js/Mailer/MessageEditorController.js b/UI/WebServerResources/js/Mailer/MessageEditorController.js index 2c49399a5..8c39297d0 100644 --- a/UI/WebServerResources/js/Mailer/MessageEditorController.js +++ b/UI/WebServerResources/js/Mailer/MessageEditorController.js @@ -46,7 +46,7 @@ onErrorItem: function(item, response, status, headers) { $mdToast.show( $mdToast.simple() - .content(l('An error occured while uploading' + ' ' + item.file.name)) + .content(l('Error while uploading the file \"%{0}\":', item.file.name)) .position('top right') .hideDelay(3000)); this.removeFromQueue(item);