Fix for bug #2332
parent
98e4c8ca55
commit
6c9b1a494f
1
NEWS
1
NEWS
|
@ -3,6 +3,7 @@
|
|||
|
||||
Enhancements
|
||||
- added support for email categories using EAS (#2995)
|
||||
- now possible to always send vacation messages (#2332)
|
||||
|
||||
Bug fixes
|
||||
- (regression) fixed sending a message when mail module is not active (#3088)
|
||||
|
|
|
@ -835,13 +835,16 @@ static NSString *sieveScriptName = @"sogo";
|
|||
|
||||
if (values && [[values objectForKey: @"enabled"] boolValue])
|
||||
{
|
||||
NSMutableString *vacation_script;
|
||||
NSArray *addresses;
|
||||
NSString *text;
|
||||
BOOL ignore;
|
||||
|
||||
BOOL ignore, alwaysSend;
|
||||
int days, i;
|
||||
|
||||
days = [[values objectForKey: @"daysBetweenResponse"] intValue];
|
||||
addresses = [values objectForKey: @"autoReplyEmailAddresses"];
|
||||
alwaysSend = [[values objectForKey: @"alwaysSend"] boolValue];
|
||||
ignore = [[values objectForKey: @"ignoreLists"] boolValue];
|
||||
text = [values objectForKey: @"autoReplyText"];
|
||||
b = YES;
|
||||
|
@ -849,28 +852,38 @@ static NSString *sieveScriptName = @"sogo";
|
|||
if (days == 0)
|
||||
days = 7;
|
||||
|
||||
vacation_script = [NSMutableString string];
|
||||
|
||||
[req addObjectUniquely: @"vacation"];
|
||||
|
||||
// Skip mailing lists
|
||||
if (ignore)
|
||||
[script appendString: @"if allof ( not exists [\"list-help\", \"list-unsubscribe\", \"list-subscribe\", \"list-owner\", \"list-post\", \"list-archive\", \"list-id\", \"Mailing-List\"], not header :comparator \"i;ascii-casemap\" :is \"Precedence\" [\"list\", \"bulk\", \"junk\"], not header :comparator \"i;ascii-casemap\" :matches \"To\" \"Multiple recipients of*\" ) {"];
|
||||
[vacation_script appendString: @"if allof ( not exists [\"list-help\", \"list-unsubscribe\", \"list-subscribe\", \"list-owner\", \"list-post\", \"list-archive\", \"list-id\", \"Mailing-List\"], not header :comparator \"i;ascii-casemap\" :is \"Precedence\" [\"list\", \"bulk\", \"junk\"], not header :comparator \"i;ascii-casemap\" :matches \"To\" \"Multiple recipients of*\" ) {"];
|
||||
|
||||
[script appendFormat: @"vacation :days %d :addresses [", days];
|
||||
[vacation_script appendFormat: @"vacation :days %d :addresses [", days];
|
||||
|
||||
for (i = 0; i < [addresses count]; i++)
|
||||
{
|
||||
[script appendFormat: @"\"%@\"", [addresses objectAtIndex: i]];
|
||||
[vacation_script appendFormat: @"\"%@\"", [addresses objectAtIndex: i]];
|
||||
|
||||
if (i == [addresses count]-1)
|
||||
[script appendString: @"] "];
|
||||
[vacation_script appendString: @"] "];
|
||||
else
|
||||
[script appendString: @", "];
|
||||
[vacation_script appendString: @", "];
|
||||
}
|
||||
|
||||
[script appendFormat: @"text:\r\n%@\r\n.\r\n;\r\n", text];
|
||||
[vacation_script appendFormat: @"text:\r\n%@\r\n.\r\n;\r\n", text];
|
||||
|
||||
if (ignore)
|
||||
[script appendString: @"}\r\n"];
|
||||
[vacation_script appendString: @"}\r\n"];
|
||||
|
||||
//
|
||||
// See http://sogo.nu/bugs/view.php?id=2332 for details
|
||||
//
|
||||
if (alwaysSend)
|
||||
[script insertString: vacation_script atIndex: 0];
|
||||
else
|
||||
[script appendString: vacation_script];
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
"Days between responses :" = "Days between responses:";
|
||||
"Do not send responses to mailing lists" = "Do not send responses to mailing lists";
|
||||
"Disable auto reply on" = "Disable auto reply on";
|
||||
"Always send vacation message response" = "Always send vacation message response";
|
||||
"Please specify your message and your email addresses for which you want to enable auto reply."
|
||||
= "Please specify your message and your email addresses for which you want to enable auto reply.";
|
||||
"Your vacation message must not end with a single dot on a line." = "Your vacation message must not end with a single dot on a line.";
|
||||
|
|
|
@ -1127,6 +1127,30 @@ static NSArray *reminderValues = nil;
|
|||
return ignore;
|
||||
}
|
||||
|
||||
//
|
||||
// See http://sogo.nu/bugs/view.php?id=2332 for details
|
||||
//
|
||||
- (void) setAlwaysSend: (BOOL) ignoreLists
|
||||
{
|
||||
[vacationOptions setObject: [NSNumber numberWithBool: ignoreLists]
|
||||
forKey: @"alwaysSend"];
|
||||
}
|
||||
|
||||
- (BOOL) alwaysSend
|
||||
{
|
||||
NSNumber *obj;
|
||||
BOOL ignore;
|
||||
|
||||
obj = [vacationOptions objectForKey: @"alwaysSend"];
|
||||
|
||||
if (obj == nil)
|
||||
ignore = NO; // defaults to NO
|
||||
else
|
||||
ignore = [obj boolValue];
|
||||
|
||||
return ignore;
|
||||
}
|
||||
|
||||
- (BOOL) enableVacationEndDate
|
||||
{
|
||||
return [[vacationOptions objectForKey: @"endDateEnabled"] boolValue];
|
||||
|
|
|
@ -623,7 +623,13 @@
|
|||
date="vacationEndDate"
|
||||
const:dayStartHour="0"
|
||||
const:dayEndHour="23"
|
||||
/>
|
||||
/><br/>
|
||||
|
||||
<label><input type="checkbox"
|
||||
const:name="alwaysSend"
|
||||
const:id="alwaysSend"
|
||||
var:checked="alwaysSend" />
|
||||
<var:string label:value="Always send vacation message response" /></label><br/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue