View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002272 | SOGo | Web Mail | public | 2013-03-21 13:14 | 2016-06-03 18:07 |
Reporter | dab1818 | Assigned To | francis | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | feedback | Resolution | reopened | ||
Product Version | 2.0.4b | ||||
Fixed in Version | 3.1.1 | ||||
Summary | 0002272: wrong file names in attachment with spaces, punctation, cyriilic characters in name ... | ||||
Description | create new message. ckick "send". | ||||
Additional Information | message from logfile: files in newDraft... folder: | ||||
Tags | No tags attached. | ||||
2013-03-21 13:14
|
|
Can you retest with v2.0.7? |
|
tested again with sogo-2.0.7:
no error messages in sogod.log |
|
mantis eating url and russian filenames... wikipedia says: |
|
Attach a sample message to this ticket, not a screenshot. |
|
2013-08-12 14:55
|
|
mantis failed with cyrillic filename :( APPLICATION ERROR 0000401 Database query failed. Error received from database was 0001267: Illegal mix of collations (latin1_swedish_ci,IMPLICIT) and (utf8_general_ci,COERCIBLE) for operation '=' for the query: SELECT COUNT(*) |
|
2013-08-12 14:58
|
viewsource.txt (2,091 bytes)
Return-path: <a888@bla-bla-bla.ru> Envelope-to: a888@bla-bla-bla.ru Delivery-date: Mon, 12 Aug 2013 18:52:36 +0400 Received: from sogo by bla-bla-bla.ru with local (Exim 4.80.1) (envelope-from <a888@bla-bla-bla.ru>) id 1V8tU4-0005pq-05 for a888@bla-bla-bla.ru; Mon, 12 Aug 2013 18:52:36 +0400 User-Agent: SOGoMail 2.0.7 X-Forward: 10.15.16.200 MIME-Version: 1.0 from: =?utf-8?q?=D0=A4=D0=B0=D0=BC=D0=B8=D0=BB=D0=B8=D1=8F_=D0=98=D0=BC=D1=8F_=D0=9E=D1=82=D1=87=D0=B5=D1=81=D1=82=D0=B2=D0=BE?= <a888@bla-bla-bla.ru> subject: test message-id: <5730-5208f680-1-47ddf080@214614725> to: =?utf-8?q?=D0=A4=D0=B0=D0=BC=D0=B8=D0=BB=D0=B8=D1=8F_=D0=98=D0=BC=D1=8F_=D0=9E=D1=82=D1=87=D0=B5=D1=81=D1=82=D0=B2=D0=BE?= <a888@bla-bla-bla.ru> content-type: multipart/mixed; boundary="----=_=-_OpenGroupware_org_NGMime-22320-1376319155.995148-0------" date: Mon, 12 Aug 2013 18:52:35 +0400 ------=_=-_OpenGroupware_org_NGMime-22320-1376319155.995148-0------ content-type: text/plain; charset=utf-8 content-length: 4 content-transfer-encoding: 7bit test ------=_=-_OpenGroupware_org_NGMime-22320-1376319155.995148-0------ content-type: text/plain content-disposition: attachment; filename="one 'two' %22three%22.txt" content-length: 32 content-transfer-encoding: 7bit content of one 'two' "three".txt ------=_=-_OpenGroupware_org_NGMime-22320-1376319155.995148-0------ content-type: text/plain content-disposition: attachment; filename="=?utf-8?q?=D0=90=D0=91=D0=92=D0=93=D0=94=D0=95=D0=81=D0=96=D0=97=D0=98=D0=9A=D0=9B=D0=9C=D0=9D=D0=9E=D0=9F=D0=A0=D0=A1?=" content-length: 415 content-transfer-encoding: quoted-printable content of =D0=90=D0=91=D0=92=D0=93=D0=94=D0=95=D0=81=D0=96=D0=97=D0=98= =D0=9A=D0=9B=D0=9C=D0=9D=D0=9E=D0=9F=D0=A0=D0=A1=D0=A2=D0=A3=D0=A4=D0=A5= =D0=A6=D0=A7=D0=A8=D0=A9=D0=AC=D0=AB=D0=AA=D0=AD=D0=AE=D0=AF=D0=B0=D0=B1= =D0=B2=D0=B3=D0=B4=D0=B5=D1=91=D0=B6=D0=B7=D0=B8=D0=BA=D0=BB=D0=BC=D0=BD= =D0=BE=D0=BF=D1=80=D1=81=D1=82=D1=83=D1=84=D1=85=D1=86=D1=87=D1=88=D1=89= =D1=8C=D1=8B=D1=8A=D1=8D=D1=8E=D1=8F.txt ------=_=-_OpenGroupware_org_NGMime-22320-1376319155.995148-0-------- |
Just zip the mail and attach it to this ticket, it's not that hard to do. |
|
2013-08-19 05:03
|
|
Can you retest with v2.2.0? |
|
tested again with sogo-2.2.3: problem 1. quotes in filenames firefox (mozilla-gecko-based browsers) encoded as ("escaped"): chromium (webkit) encoded as ("url-encoded"): problem 2. russian uppercase 'T' letter (Unicode 1058 U+0422) break filename |
|
1) problem with russian uppercase 'T' letter (0x0422) comes from unichar 0x0422 => unsigned char 0x22 = ascii quote! this is bug. SOGo with MimeLogEnabled = YES write to log: 2) SOGo not understand filenames with double-quote as specified in http://www.w3.org/Protocols/rfc822/: I tried to fix this two bugs. tested on SOGo-2.3.2, firefox, seamonkey, chromium, thunderbird, apple mail. |
|
sogo_quotes_in_attachments.patch (2,743 bytes)
diff -ur SOGo.orig/SoObjects/Mailer/SOGoDraftObject.m SOGo/SoObjects/Mailer/SOGoDraftObject.m --- SOGo.orig/SoObjects/Mailer/SOGoDraftObject.m 2015-09-16 22:41:36.000000000 +0400 +++ SOGo/SoObjects/Mailer/SOGoDraftObject.m 2015-10-08 17:25:52.892008104 +0400 @@ -1269,7 +1269,7 @@ { s = [self mimeTypeForExtension:[_name pathExtension]]; if ([_name length] > 0) - s = [s stringByAppendingFormat: @"; name=\"%@\"", _name]; + s = [s stringByAppendingFormat: @"; name=\"%@\"", [_name stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""]]; } return s; @@ -1295,7 +1295,7 @@ cdtype = @"attachment"; cd = [cdtype stringByAppendingString: @"; filename=\""]; - cd = [cd stringByAppendingString: _name]; + cd = [cd stringByAppendingString: [_name stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""]]; cd = [cd stringByAppendingString: @"\""]; // TODO: add size parameter (useful addition, RFC 2183) diff -ur SOGo.orig/UI/MailerUI/UIxMailEditor.m SOGo/UI/MailerUI/UIxMailEditor.m --- SOGo.orig/UI/MailerUI/UIxMailEditor.m 2015-09-16 22:41:36.000000000 +0400 +++ SOGo/UI/MailerUI/UIxMailEditor.m 2015-10-08 17:30:14.202730035 +0400 @@ -523,6 +523,7 @@ NSString *newFilename, *baseFilename, *extension; unsigned int variation; + filename = [filename stringByReplacingOccurrencesOfString:@"\\\"" withString:@"\""]; /* to real filename */ if (!attachedFiles) attachedFiles = [NSMutableArray new]; diff -ur SOGo.orig/UI/Templates/MailerUI/UIxMailEditor.wox SOGo/UI/Templates/MailerUI/UIxMailEditor.wox --- SOGo.orig/UI/Templates/MailerUI/UIxMailEditor.wox 2015-09-16 22:41:36.000000000 +0400 +++ SOGo/UI/Templates/MailerUI/UIxMailEditor.wox 2015-10-08 17:32:23.181441089 +0400 @@ -118,7 +118,7 @@ <li class="attachButton"><span class="button fileinput-button"><span><img rsrc:src="title_attachment_14x14.png" /> <var:string label:value="Attach"/></span><input id="fileUpload" type="file" name="attachments" tabindex="-1" multiple="multiple"/></span></li> <var:foreach list="attachmentAttrs" item="attachment" ><li class="progressDone" var:data-filename="attachment.filename"> - <i class="icon-attachment"><!-- icon --></i><a var:href="attachment.url" target="_new"><var:string value="attachment.filename"/></a><span class="muted">(<var:string value="attachment.size" formatter="sizeFormatter" />)</span> + <i class="icon-attachment"><!-- icon --></i><a var:href="attachment.url" target="_new"><var:string value="attachment.filename" const:escapeHTML="YES"/></a><span class="muted">(<var:string value="attachment.size" formatter="sizeFormatter"/>)</span> </li></var:foreach> </ul> </div> |
|
sope_quotes_in_attachments.patch (5,220 bytes)
diff -ur SOPE.orig/sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m SOPE/sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m --- SOPE.orig/sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m 2015-09-16 22:26:50.000000000 +0400 +++ SOPE/sope-mime/NGMime/NGMimeContentDispositionHeaderFieldGenerator.m 2015-10-08 17:42:49.281850835 +0400 @@ -83,6 +83,9 @@ int desLen; char *des; + bytes = [[tmp stringByReplacingOccurrencesOfString:@"\\\"" withString:@"\""] cStringUsingEncoding: NSUTF8StringEncoding]; + length = strlen(bytes); + desLen = length * 3 + 20; des = calloc(desLen + 2, sizeof(char)); diff -ur SOPE.orig/sope-mime/NGMime/NGMimeUtilities.h SOPE/sope-mime/NGMime/NGMimeUtilities.h --- SOPE.orig/sope-mime/NGMime/NGMimeUtilities.h 2015-09-16 22:26:50.000000000 +0400 +++ SOPE/sope-mime/NGMime/NGMimeUtilities.h 2015-10-08 17:13:56.917917163 +0400 @@ -42,52 +42,52 @@ // single chars NSDictionary *parseParameters(id self, NSString *_str, unichar *cstr); -static inline BOOL isRfc822_CR(unsigned char _byte) { +static inline BOOL isRfc822_CR(unichar _byte) { return (_byte == 13); } -static inline BOOL isRfc822_LF(unsigned char _byte) { +static inline BOOL isRfc822_LF(unichar _byte) { return (_byte == 10); } -static inline BOOL isRfc822_HTAB(unsigned char _byte) { +static inline BOOL isRfc822_HTAB(unichar _byte) { return (_byte == 9); } -static inline BOOL isRfc822_SPACE(unsigned char _byte) { +static inline BOOL isRfc822_SPACE(unichar _byte) { return (_byte == 32); } -static inline BOOL isRfc822_QUOTE(unsigned char _byte) { +static inline BOOL isRfc822_QUOTE(unichar _byte) { return (_byte == 34); } // ranges -static inline BOOL isRfc822_CHAR(unsigned char _byte) { +static inline BOOL isRfc822_CHAR(unichar _byte) { return (_byte < 128); } -static inline BOOL isRfc822_CTL(unsigned char _byte) { +static inline BOOL isRfc822_CTL(unichar _byte) { return (_byte < 32) || (_byte == 127); } -static inline BOOL isRfc822_ALPHA(unsigned char _byte) { +static inline BOOL isRfc822_ALPHA(unichar _byte) { return (((_byte >= 65) && (_byte <= 90)) || ((_byte >= 97) && (_byte <= 122))); } -static inline BOOL isRfc822_DIGIT(unsigned char _byte) { +static inline BOOL isRfc822_DIGIT(unichar _byte) { return (_byte >= 48) && (_byte <= 57); } -static inline BOOL isRfc822_LWSP(unsigned char _byte) { +static inline BOOL isRfc822_LWSP(unichar _byte) { return (isRfc822_SPACE(_byte) || isRfc822_HTAB(_byte)); } -static inline BOOL isRfc822_FieldNameChar(unsigned char _byte) { +static inline BOOL isRfc822_FieldNameChar(unichar _byte) { return (isRfc822_CHAR(_byte) && !(isRfc822_CTL(_byte) || isRfc822_SPACE(_byte) || (_byte == ':'))); } -static inline BOOL isRfc822_AtomChar(unsigned char _byte) { +static inline BOOL isRfc822_AtomChar(unichar _byte) { return (isRfc822_CHAR(_byte) && !(isRfc822_SpecialByte(_byte) || isRfc822_SPACE(_byte) || isRfc822_CTL(_byte))); @@ -95,7 +95,7 @@ // ******************** MIME *********************** -static inline BOOL isMime_SpecialByte(unsigned char _byte) { +static inline BOOL isMime_SpecialByte(unichar _byte) { switch (_byte) { case '(': case ')': case '<': case '>': case '@': case ',': case ';': case ':': case '"': case '\\': @@ -106,21 +106,21 @@ } } -static inline BOOL isMime_TokenChar(unsigned char _byte) { +static inline BOOL isMime_TokenChar(unichar _byte) { return (isRfc822_CHAR(_byte) && !(isRfc822_CTL(_byte) || isRfc822_SPACE(_byte) || isMime_SpecialByte(_byte))); } -static inline BOOL isMime_SafeChar(unsigned char _byte) { +static inline BOOL isMime_SafeChar(unichar _byte) { return ((_byte >= 33 && _byte <= 60) || (_byte >= 62 && _byte <= 126)); } -static inline BOOL isMime_ValidTypeXTokenChar(unsigned char _byte) { +static inline BOOL isMime_ValidTypeXTokenChar(unichar _byte) { return !isRfc822_SPACE(_byte); } -static inline BOOL isMime_ValidTypeAttributeChar(unsigned char _byte) { +static inline BOOL isMime_ValidTypeAttributeChar(unichar _byte) { return isMime_TokenChar(_byte); } diff -ur SOPE.orig/sope-mime/NGMime/NGMimeUtilities.m SOPE/sope-mime/NGMime/NGMimeUtilities.m --- SOPE.orig/sope-mime/NGMime/NGMimeUtilities.m 2015-09-16 22:26:50.000000000 +0400 +++ SOPE/sope-mime/NGMime/NGMimeUtilities.m 2015-10-08 17:37:04.215299250 +0400 @@ -157,12 +157,14 @@ cstr++; tmp = cstr; len = 0; - while (!isRfc822_QUOTE(*cstr) && (*cstr != '\0')) { + while ( (!(isRfc822_QUOTE(*cstr) && *(cstr - 1) != '\\')) && (*cstr != '\0')) { cstr++; len++; } attrValue = [[[NSString alloc] initWithCharacters:tmp length:len] autorelease]; + /* webkit hack: "urldecode" quotes only. @seealso: https://bugs.webkit.org/show_bug.cgi?id=62107 https://www.w3.org/Bugs/Public/show_bug.cgi?id=16909 */ + attrValue = [attrValue stringByReplacingOccurrencesOfString:@"%22" withString:@"\\\""]; if (*cstr == '\0') { // quote was not closed if (MimeLogEnabled) |
|
|
|
may be patches must be pushed to github? |
|
retested with sogo-2.3.11: with sogo-3.1.0: |
|
sogo_quotes_in_attachments-3.1.0.patch (1,472 bytes)
diff -ur SOGo.orig/SoObjects/Mailer/SOGoDraftObject.m SOGo/SoObjects/Mailer/SOGoDraftObject.m --- SOGo.orig/SoObjects/Mailer/SOGoDraftObject.m 2015-09-16 22:41:36.000000000 +0400 +++ SOGo/SoObjects/Mailer/SOGoDraftObject.m 2015-10-08 17:25:52.892008104 +0400 @@ -1269,7 +1269,7 @@ { s = [self mimeTypeForExtension:[_name pathExtension]]; if ([_name length] > 0) - s = [s stringByAppendingFormat: @"; name=\"%@\"", _name]; + s = [s stringByAppendingFormat: @"; name=\"%@\"", [_name stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""]]; } return s; @@ -1295,7 +1295,7 @@ cdtype = @"attachment"; cd = [cdtype stringByAppendingString: @"; filename=\""]; - cd = [cd stringByAppendingString: _name]; + cd = [cd stringByAppendingString: [_name stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""]]; cd = [cd stringByAppendingString: @"\""]; // TODO: add size parameter (useful addition, RFC 2183) diff -ur SOGo.orig/UI/MailerUI/UIxMailEditor.m SOGo/UI/MailerUI/UIxMailEditor.m --- SOGo.orig/UI/MailerUI/UIxMailEditor.m 2015-09-16 22:41:36.000000000 +0400 +++ SOGo/UI/MailerUI/UIxMailEditor.m 2015-10-08 17:30:14.202730035 +0400 @@ -523,6 +523,7 @@ NSString *newFilename, *baseFilename, *extension; unsigned int variation; + filename = [filename stringByReplacingOccurrencesOfString:@"\\\"" withString:@"\""]; /* to real filename */ if (!attachedFiles) attachedFiles = [NSMutableArray new]; |
|
retested with 3.1.1: attached filename: displayed as (depending on window size): but tooltip/title always visible as:
|
|
sogo: master 1dca078c 2016-05-31 15:31 Details Diff |
Improve handling of attachments names with quotes Partially resolves 0002272 |
Affected Issues 0002272 |
|
mod - SoObjects/Mailer/SOGoDraftObject.m | Diff File | ||
mod - SoObjects/Mailer/SOGoMailObject.m | Diff File | ||
sogo: master c11839cd 2016-05-31 15:34 Details Diff |
Improve handling of attachments names with quotes Partially resolves 0002272 |
Affected Issues 0002272 |
|
mod - UI/MailerUI/UIxMailEditor.m | Diff File | ||
sogo: v2 d9d8ed37 2016-06-01 09:18 Details Diff |
Improve handling of attachments names with quotes Partially resolves 0002272 |
Affected Issues 0002272 |
|
mod - SoObjects/Mailer/SOGoDraftObject.m | Diff File | ||
mod - UI/MailerUI/UIxMailEditor.m | Diff File | ||
mod - UI/Templates/MailerUI/UIxMailEditor.wox | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2013-03-21 13:14 | dab1818 | New Issue | |
2013-03-21 13:14 | dab1818 | File Added: screen-2013-03-21-14-34-41.png | |
2013-08-09 20:14 | ludovic | Note Added: 0005869 | |
2013-08-12 11:09 | dab1818 | Note Added: 0005887 | |
2013-08-12 11:16 | dab1818 | Note Added: 0005888 | |
2013-08-12 12:40 | ludovic | Note Added: 0005889 | |
2013-08-12 14:55 | dab1818 | File Added: one \'two\' \"three\".txt | |
2013-08-12 14:57 | dab1818 | Note Added: 0005891 | |
2013-08-12 14:58 | dab1818 | File Added: viewsource.txt | |
2013-08-12 14:58 | ludovic | Note Added: 0005892 | |
2013-08-19 05:03 | dab1818 | File Added: testfiles.7z | |
2014-03-07 01:02 | ludovic | Note Added: 0006664 | |
2014-05-20 06:56 | dab1818 | Note Added: 0007052 | |
2014-05-20 06:56 | dab1818 | File Added: testfiles.zip | |
2015-10-09 11:45 | dab1818 | Note Added: 0008984 | |
2015-10-09 11:45 | dab1818 | File Added: sogo_quotes_in_attachments.patch | |
2015-10-09 11:45 | dab1818 | File Added: sope_quotes_in_attachments.patch | |
2015-10-09 11:45 | dab1818 | File Added: screen-2015-10-09-12-07-24.png | |
2015-12-03 09:42 | dab1818 | Note Added: 0009185 | |
2016-05-24 16:47 | dab1818 | Note Added: 0010211 | |
2016-05-24 16:47 | dab1818 | File Added: sogo_quotes_in_attachments-3.1.0.patch | |
2016-05-31 19:33 | francis | Changeset attached | => sogo master 1dca078c |
2016-05-31 19:33 | francis | Assigned To | => francis |
2016-05-31 19:33 | francis | Resolution | open => fixed |
2016-05-31 19:35 | francis | Changeset attached | => sogo master c11839cd |
2016-06-01 13:19 | francis | Changeset attached | => sogo v2 d9d8ed37 |
2016-06-01 13:24 | francis | Status | new => resolved |
2016-06-01 13:24 | francis | Fixed in Version | => 3.1.1 |
2016-06-03 18:07 | dab1818 | Note Added: 0010291 | |
2016-06-03 18:07 | dab1818 | Status | resolved => feedback |
2016-06-03 18:07 | dab1818 | Resolution | fixed => reopened |