(feat) can now discard incoming mails during vacation

pull/228/merge
Ludovic Marcotte 2017-06-01 14:49:09 -04:00
parent e8e0df8b53
commit 6e04a2d99c
4 changed files with 20 additions and 2 deletions

1
NEWS
View File

@ -12,6 +12,7 @@ Enhancements
- [web] added custom fields support from Thunderbird's address book
- [web] added Latvian (lv) translation - thanks to Juris Balandis
- [web] expose user's defaults and settings inline
- [web] can now discard incoming mails during vacation
Bug fixes
- [web] respect SOGoLanguage and SOGoSupportedLanguages (#4169)

View File

@ -831,8 +831,10 @@ static NSString *sieveScriptName = @"sogo";
return NO;
}
//
// We handle vacation messages.
// See http://ietfreport.isoc.org/idref/draft-ietf-sieve-vacation/
//
values = [ud vacationOptions];
now = [[NSCalendarDate calendarDate] timeIntervalSince1970];
@ -849,13 +851,14 @@ static NSString *sieveScriptName = @"sogo";
NSString *text, *templateFilePath, *customSubject;
SOGoTextTemplateFile *templateFile;
BOOL ignore, alwaysSend, useCustomSubject;
BOOL ignore, alwaysSend, useCustomSubject, discardMails;
int days, i;
allConditions = [NSMutableArray array];
days = [[values objectForKey: @"daysBetweenResponse"] intValue];
addresses = [values objectForKey: @"autoReplyEmailAddresses"];
alwaysSend = [[values objectForKey: @"alwaysSend"] boolValue];
discardMails = [[values objectForKey: @"discardMails"] boolValue];
ignore = [[values objectForKey: @"ignoreLists"] boolValue];
useCustomSubject = [[values objectForKey: @"customSubjectEnabled"] boolValue];
customSubject = [values objectForKey: @"customSubject"];
@ -962,6 +965,10 @@ static NSString *sieveScriptName = @"sogo";
if ([allConditions count])
[vacation_script appendString: @"}\r\n"];
// Should we discard incoming mails during vacation?
if (discardMails)
[vacation_script appendString: @"discard;\r\n"];
//
// See https://sogo.nu/bugs/view.php?id=2332 for details
//

View File

@ -47,6 +47,7 @@
"Enable auto reply on" = "Enable auto reply on";
"Disable auto reply on" = "Disable auto reply on";
"Always send vacation message response" = "Always send vacation message response";
"Discard incoming mails during vacation" = "Discard incoming mails during vacation";
"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.";
@ -408,4 +409,4 @@
"animation_NORMAL" = "Normal";
/* Limited Animation Mode */
"animation_LIMITED" = "Limited";
"animation_NONE" = "None";
"animation_NONE" = "None";

View File

@ -951,6 +951,15 @@
</md-checkbox>
</div>
<div>
<md-checkbox
ng-model="app.preferences.defaults.Vacation.discardMails"
ng-true-value="1"
ng-false-value="0">
<var:string label:value="Discard incoming mails during vacation"/>
</md-checkbox>
</div>
</div>
</div>
</md-tab>