feat(mail) Introduce option SOGoVacationAllowZeroDays to allow a sieve vacation days value of 0

This commit is contained in:
y9048a
2024-11-21 11:52:51 +01:00
committed by QHivert
parent 7a7f85d1a7
commit 02dd5c3501
6 changed files with 38 additions and 6 deletions
@@ -2443,6 +2443,16 @@ appended to the user's vacation message. For example:
See `SOGoVacationHeaderTemplateFile` for available template variables.
|D |SOGoVacationAllowZeroDays
|Parameter used to enable an option of 0 for the vacation days setting.
A value of 0 means that auto response mails are sent for every incoming mail.
This option has to be supported by the IMAP host
(see https://doc.dovecot.org/2.3/settings/pigeonhole-ext/vacation/#pigeonhole_setting-sieve_vacation_min_period
for instructions regarding Dovecot/Pigeonhole).
Defaults to `NO` when unset.
|D |SOGoForwardEnabled
|Parameter used to activate the edition from the preferences window of a
forwarding email address. Requires Sieve script support on the IMAP
+1
View File
@@ -60,6 +60,7 @@
- (NSString *) vacationDefaultSubject;
- (NSString *) vacationHeaderTemplateFile;
- (NSString *) vacationFooterTemplateFile;
- (BOOL) vacationAllowZeroDays;
- (NSString *) mailingMechanism;
- (NSString *) smtpServer;
- (BOOL)smtpMasterUserEnabled;
+12
View File
@@ -277,6 +277,18 @@
return [self stringForKey: @"SOGoVacationFooterTemplateFile"];
}
- (BOOL) vacationAllowZeroDays
{
id o;
o = [self stringForKey: @"SOGoVacationAllowZeroDays"];
if (o)
return [o boolValue];
return NO;
}
- (NSString *) mailingMechanism
{
NSString *mailingMechanism;
+2 -2
View File
@@ -1016,8 +1016,8 @@ static NSString *sieveScriptName = @"sogo";
text = [NSString stringWithFormat: @"%@%@", text, [templateFile textForUser: user]];
}
if (days == 0)
days = 7;
if (days <= 0)
days = [dd vacationAllowZeroDays] ? 0 : 7;
vacation_script = [NSMutableString string];
+6 -2
View File
@@ -1000,12 +1000,16 @@ static NSArray *reminderValues = nil;
//
- (NSArray *) daysBetweenResponsesList
{
static NSArray *daysBetweenResponses = nil;
static NSMutableArray *daysBetweenResponses = nil;
if (!daysBetweenResponses)
{
daysBetweenResponses = [NSArray arrayWithObjects: @"1", @"2", @"3",
daysBetweenResponses = [NSMutableArray arrayWithObjects: @"1", @"2", @"3",
@"5", @"7", @"14", @"21", @"30", nil];
if ([[user domainDefaults] vacationAllowZeroDays])
{
[daysBetweenResponses insertObject:@"0" atIndex:0];
}
[daysBetweenResponses retain];
}
@@ -1175,7 +1175,12 @@
ng-model="app.preferences.defaults.Vacation.daysBetweenResponse">
<var:foreach list="daysBetweenResponsesList" item="item">
<md-option var:value="item">
<var:string value="item"/>
<var:if condition="item" const:value="0">
<i><var:string label:value="Always send vacation message response"/></i>
</var:if>
<var:if condition="item" const:value="0" const:negate="YES">
<var:string value="item"/>
</var:if>
</md-option>
</var:foreach>
</md-select>
@@ -1499,4 +1504,4 @@
</script>
</var:component>
</var:component>