View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001344 | SOGo | Web Preferences | public | 2011-06-22 09:08 | 2011-07-05 17:32 |
Reporter | bear-cave | Assigned To | ludovic | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 1.3.7a | ||||
Target Version | 1.3.8 | Fixed in Version | 1.3.8 | ||
Summary | 0001344: Sieve filter 'reject' generates incorrect script on single-line messages | ||||
Description | If you create a sieve filter with a 'reject' action, and the message accompanying the reject is a single line, then incorrect sieve is generated. The offending line is of the form:
The Dovecot ManageSieve rejects this - "invalid character after 'text:' in multiline string - and drops the filter file. So all your filters mysteriously don't work. | ||||
Additional Information | From a quick reading of RFC5228, it looks to me like generally single line text is simply quoted. Multi-line text starts with 'text:'. So the above should be:
or
A message with In SOGoSieveConverter.m, asSieveQuotedString() checks the input string for newlines and generates single-line format if none, or multi-line format if any are present. In the latter case it does not add the 'text:' prefix. In the case of 'reject' this is always prepended to the result of asSieveQuotedString(). Hence if the reject message is a single line, 'text:' is present incorrectly. I assume that there is scope for the reverse problem to occur elsewhere - multi-line text being returned to other commands expecting a single line quoted string. I think what should happen is that 'text:' should be prepended to multi-line values returned from asSieveQuotedString(). Something like the attached (untested, and I'm Objective C ignorant) patch. | ||||
Tags | No tags attached. | ||||
2011-06-22 09:08
|
reject.patch (1,036 bytes)
--- SoObjects/Mailer/SOGoSieveConverter.m 26be786fa82aeb7561b9b066b973742a0aed7b83 +++ SoObjects/Mailer/SOGoSieveConverter.m 8bfa9d286cb751b8f2ff2f3a7ca4f01d244e1cf9 @@ -87,7 +87,7 @@ static NSDictionary *methodRequirements [newLines addObject: line]; } - newText = [NSString stringWithFormat: @"\r\n%@\r\n.\r\n", + newText = [NSString stringWithFormat: @"text: \r\n%@\r\n.\r\n", [newLines componentsJoinedByString: @"\n"]]; return newText; @@ -467,7 +467,7 @@ static NSDictionary *methodRequirements sieveAction = [NSString stringWithFormat: @"%@ %@", method, [argument asSieveQuotedString]]; else if ([method isEqualToString: @"reject"]) - sieveAction = [NSString stringWithFormat: @"%@ text: %@", + sieveAction = [NSString stringWithFormat: @"%@ %@", method, [argument asSieveQuotedString]]; else scriptError |
2011-06-26 18:51
|
reject2.patch (1,035 bytes)
--- SoObjects/Mailer/SOGoSieveConverter.m 26be786fa82aeb7561b9b066b973742a0aed7b83 +++ SoObjects/Mailer/SOGoSieveConverter.m 824e2ee181dea55afa94ee0d5e04da7456740864 @@ -87,7 +87,7 @@ static NSDictionary *methodRequirements [newLines addObject: line]; } - newText = [NSString stringWithFormat: @"\r\n%@\r\n.\r\n", + newText = [NSString stringWithFormat: @"text:\r\n%@\r\n.\r\n", [newLines componentsJoinedByString: @"\n"]]; return newText; @@ -467,7 +467,7 @@ static NSDictionary *methodRequirements sieveAction = [NSString stringWithFormat: @"%@ %@", method, [argument asSieveQuotedString]]; else if ([method isEqualToString: @"reject"]) - sieveAction = [NSString stringWithFormat: @"%@ text: %@", + sieveAction = [NSString stringWithFormat: @"%@ %@", method, [argument asSieveQuotedString]]; else scriptError |
I have now tried the attached patch 'reject2' and confirmed that it does fix the problem. Single line and multi-line reject messages generate correct Sieve, and 'redirect', the only other free-text argument Sieve action available from the web still works too. Please consider applying. (I don't seem to be able to delete an attachment I uploaded. Is this expected?) |
|
Thanks for your patch! |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2011-06-22 09:08 | bear-cave | New Issue | |
2011-06-22 09:08 | bear-cave | File Added: reject.patch | |
2011-06-26 18:51 | bear-cave | File Added: reject2.patch | |
2011-06-26 18:55 | bear-cave | Note Added: 0002639 | |
2011-06-27 14:12 | ludovic | Status | new => assigned |
2011-06-27 14:12 | ludovic | Assigned To | => ludovic |
2011-06-27 14:13 | ludovic | Target Version | => 1.3.8 |
2011-07-05 17:32 | ludovic | Note Added: 0002658 | |
2011-07-05 17:32 | ludovic | Status | assigned => resolved |
2011-07-05 17:32 | ludovic | Fixed in Version | => 1.3.8 |
2011-07-05 17:32 | ludovic | Resolution | open => fixed |