parent
7f4474f47c
commit
4744170628
|
@ -1998,6 +1998,30 @@ message expiration.
|
||||||
See the _Cronjob — Vacation messages expiration_ section below for
|
See the _Cronjob — Vacation messages expiration_ section below for
|
||||||
details.
|
details.
|
||||||
|
|
||||||
|
|D |SOGoVacationHeaderTemplateFile
|
||||||
|
|Parameter used to specify the path of a text file whose content must be
|
||||||
|
prepended to the user's vacation message. For example:
|
||||||
|
|
||||||
|
`SOGoVacationHeaderTemplateFile = /etc/sogo/autoresponder.header.txt;`
|
||||||
|
|
||||||
|
The following template variables can appear in the content:
|
||||||
|
|
||||||
|
[options="compact"]
|
||||||
|
* `%{username}`
|
||||||
|
* `%{daysBetweenResponse}`
|
||||||
|
|
||||||
|
|D |SOGoVacationFooterTemplateFile
|
||||||
|
|Parameter used to specify the path of a text file whose content must be
|
||||||
|
appended to the user's vacation message. For example:
|
||||||
|
|
||||||
|
`SOGoVacationFooterTemplateFile = /etc/sogo/autoresponder.footer.txt;`
|
||||||
|
|
||||||
|
See `SOGoVacationHeaderTemplateFile` for available template variables.
|
||||||
|
|
||||||
|
|D |SOGoVacationHeaderTemplateFile
|
||||||
|
|Parameter used to specify the path of a text file whose content must be
|
||||||
|
prepended to the user's vacation message.
|
||||||
|
|
||||||
|D |SOGoForwardEnabled
|
|D |SOGoForwardEnabled
|
||||||
|Parameter used to activate the edition from the preferences window of a
|
|Parameter used to activate the edition from the preferences window of a
|
||||||
forwarding email address. Requires Sieve script support on the IMAP
|
forwarding email address. Requires Sieve script support on the IMAP
|
||||||
|
@ -2280,7 +2304,7 @@ be put under `~sogo/GNUstep/Library/SOGo/Templates/PreferencesUI/`.
|
||||||
and the follow keys are supported: `vendor` (which must be set to "generic"
|
and the follow keys are supported: `vendor` (which must be set to "generic"
|
||||||
for now), `junkEmailAddress` which sets the email address to whom SOGo will
|
for now), `junkEmailAddress` which sets the email address to whom SOGo will
|
||||||
send junk mails to, `notJunkEmailAddress` which sets the email address to
|
send junk mails to, `notJunkEmailAddress` which sets the email address to
|
||||||
whome SOGo will send non-junk mails to and `limit`, which is an integer value
|
whom SOGo will send non-junk mails to and `limit`, which is an integer value
|
||||||
and sets the maximum number of mails that will be attached to a
|
and sets the maximum number of mails that will be attached to a
|
||||||
junk/not junk report sent by SOGo. Example: `SOGoMailJunkSettings = {
|
junk/not junk report sent by SOGo. Example: `SOGoMailJunkSettings = {
|
||||||
vendor = "generic"; junkEmailAddress = "spam@foo.com";
|
vendor = "generic"; junkEmailAddress = "spam@foo.com";
|
||||||
|
|
7
NEWS
7
NEWS
|
@ -4,14 +4,17 @@
|
||||||
New features
|
New features
|
||||||
- [core] now possible to define default Sieve filters (#2949)
|
- [core] now possible to define default Sieve filters (#2949)
|
||||||
- [core] now possible to set vacation message start date (#3679)
|
- [core] now possible to set vacation message start date (#3679)
|
||||||
|
- [web] add a header and/or footer to the vacation message (#1961)
|
||||||
|
|
||||||
Enhancements
|
Enhancements
|
||||||
|
- [core] when restoring data using sogo-tool, regenerate Sieve script (#3029)
|
||||||
- [web] always display name of month in week view (#3724)
|
- [web] always display name of month in week view (#3724)
|
||||||
- [web] use a speed dial (instead of a dialog) for card/list creation
|
- [web] use a speed dial (instead of a dialog) for card/list creation
|
||||||
- [web] use a speed dial for event/task creation
|
- [web] use a speed dial for event/task creation
|
||||||
- [core] when restoring data using sogo-tool, regenerate Sieve script (#3029)
|
|
||||||
|
|
||||||
Bug fixes
|
Bug fixes
|
||||||
|
- [core] properly handle sorted/deleted calendars (#3723)
|
||||||
|
- [core] properly handle flattened timezone definitions (#2690)
|
||||||
- [web] fixed generic avatar in lists (#3719)
|
- [web] fixed generic avatar in lists (#3719)
|
||||||
- [web] fixed validation in Sieve filter editor
|
- [web] fixed validation in Sieve filter editor
|
||||||
- [web] properly encode rawsource of events and tasks to avoid XSS issues (#3718)
|
- [web] properly encode rawsource of events and tasks to avoid XSS issues (#3718)
|
||||||
|
@ -21,8 +24,6 @@ Bug fixes
|
||||||
- [web] fixed time format when user chooses the default one
|
- [web] fixed time format when user chooses the default one
|
||||||
- [web] added missing delegators identities in mail editor (#3720)
|
- [web] added missing delegators identities in mail editor (#3720)
|
||||||
- [web] honor the domain default SOGoAppointmentSendEMailNotifications (#3729)
|
- [web] honor the domain default SOGoAppointmentSendEMailNotifications (#3729)
|
||||||
- [core] properly handle sorted/deleted calendars (#3723)
|
|
||||||
- [core] properly handle flattened timezone definitions (#2690)
|
|
||||||
|
|
||||||
3.1.2 (2016-06-06)
|
3.1.2 (2016-06-06)
|
||||||
------------------
|
------------------
|
||||||
|
|
|
@ -86,7 +86,8 @@ SOGo_HEADER_FILES = \
|
||||||
WOResponse+SOGo.h \
|
WOResponse+SOGo.h \
|
||||||
WOContext+SOGo.h \
|
WOContext+SOGo.h \
|
||||||
\
|
\
|
||||||
SOGoCredentialsFile.h
|
SOGoCredentialsFile.h \
|
||||||
|
SOGoTextTemplateFile.h
|
||||||
|
|
||||||
all::
|
all::
|
||||||
@touch SOGoBuild.m
|
@touch SOGoBuild.m
|
||||||
|
@ -165,7 +166,8 @@ SOGo_OBJC_FILES = \
|
||||||
WOResponse+SOGo.m \
|
WOResponse+SOGo.m \
|
||||||
WOContext+SOGo.m \
|
WOContext+SOGo.m \
|
||||||
\
|
\
|
||||||
SOGoCredentialsFile.m
|
SOGoCredentialsFile.m \
|
||||||
|
SOGoTextTemplateFile.m
|
||||||
|
|
||||||
SOGo_C_FILES += lmhash.c
|
SOGo_C_FILES += lmhash.c
|
||||||
|
|
||||||
|
|
|
@ -52,6 +52,8 @@
|
||||||
- (BOOL) forwardEnabled;
|
- (BOOL) forwardEnabled;
|
||||||
- (int) forwardConstraints;
|
- (int) forwardConstraints;
|
||||||
- (BOOL) vacationEnabled;
|
- (BOOL) vacationEnabled;
|
||||||
|
- (NSString *) vacationHeaderTemplateFile;
|
||||||
|
- (NSString *) vacationFooterTemplateFile;
|
||||||
- (NSString *) mailingMechanism;
|
- (NSString *) mailingMechanism;
|
||||||
- (NSString *) smtpServer;
|
- (NSString *) smtpServer;
|
||||||
- (NSString *) smtpAuthenticationType;
|
- (NSString *) smtpAuthenticationType;
|
||||||
|
|
|
@ -220,6 +220,16 @@
|
||||||
return [self boolForKey: @"SOGoVacationEnabled"];
|
return [self boolForKey: @"SOGoVacationEnabled"];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSString *) vacationHeaderTemplateFile
|
||||||
|
{
|
||||||
|
return [self stringForKey: @"SOGoVacationHeaderTemplateFile"];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *) vacationFooterTemplateFile
|
||||||
|
{
|
||||||
|
return [self stringForKey: @"SOGoVacationFooterTemplateFile"];
|
||||||
|
}
|
||||||
|
|
||||||
- (NSString *) mailingMechanism
|
- (NSString *) mailingMechanism
|
||||||
{
|
{
|
||||||
NSString *mailingMechanism;
|
NSString *mailingMechanism;
|
||||||
|
|
|
@ -27,6 +27,7 @@
|
||||||
#import <SOGo/NSDictionary+Utilities.h>
|
#import <SOGo/NSDictionary+Utilities.h>
|
||||||
#import <SOGo/SOGoDomainDefaults.h>
|
#import <SOGo/SOGoDomainDefaults.h>
|
||||||
#import <SOGo/SOGoUser.h>
|
#import <SOGo/SOGoUser.h>
|
||||||
|
#import <SOGo/SOGoTextTemplateFile.h>
|
||||||
|
|
||||||
#import <NGExtensions/NSObject+Logs.h>
|
#import <NGExtensions/NSObject+Logs.h>
|
||||||
#import <NGImap4/NGSieveClient.h>
|
#import <NGImap4/NGSieveClient.h>
|
||||||
|
@ -833,7 +834,8 @@ static NSString *sieveScriptName = @"sogo";
|
||||||
{
|
{
|
||||||
NSMutableString *vacation_script;
|
NSMutableString *vacation_script;
|
||||||
NSArray *addresses;
|
NSArray *addresses;
|
||||||
NSString *text;
|
NSString *text, *templateFilePath;
|
||||||
|
SOGoTextTemplateFile *templateFile;
|
||||||
|
|
||||||
BOOL ignore, alwaysSend;
|
BOOL ignore, alwaysSend;
|
||||||
int days, i;
|
int days, i;
|
||||||
|
@ -845,6 +847,24 @@ static NSString *sieveScriptName = @"sogo";
|
||||||
text = [values objectForKey: @"autoReplyText"];
|
text = [values objectForKey: @"autoReplyText"];
|
||||||
b = YES;
|
b = YES;
|
||||||
|
|
||||||
|
/* Add autoresponder header if configured */
|
||||||
|
templateFilePath = [dd vacationHeaderTemplateFile];
|
||||||
|
if (templateFilePath)
|
||||||
|
{
|
||||||
|
templateFile = [SOGoTextTemplateFile textTemplateFromFile: templateFilePath];
|
||||||
|
if (templateFile)
|
||||||
|
text = [NSString stringWithFormat: @"%@%@", [templateFile textForUser: user], text];
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Add autoresponder footer if configured */
|
||||||
|
templateFilePath = [dd vacationFooterTemplateFile];
|
||||||
|
if (templateFilePath)
|
||||||
|
{
|
||||||
|
templateFile = [SOGoTextTemplateFile textTemplateFromFile: templateFilePath];
|
||||||
|
if (templateFile)
|
||||||
|
text = [NSString stringWithFormat: @"%@%@", text, [templateFile textForUser: user]];
|
||||||
|
}
|
||||||
|
|
||||||
if (days == 0)
|
if (days == 0)
|
||||||
days = 7;
|
days = 7;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,40 @@
|
||||||
|
/* SOGoTextTemplateFile.h - this file is part of SOGo
|
||||||
|
*
|
||||||
|
* Copyright (C) 2016 Inverse inc.
|
||||||
|
*
|
||||||
|
* This file is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2, or (at your option)
|
||||||
|
* any later version.
|
||||||
|
*
|
||||||
|
* This file is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; see the file COPYING. If not, write to
|
||||||
|
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
* Boston, MA 02111-1307, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef SOGOTEXTTEMPLATEFILE_H
|
||||||
|
#define SOGOTEXTTEMPLATEFILE_H
|
||||||
|
|
||||||
|
@class SOGoUser;
|
||||||
|
|
||||||
|
@interface SOGoTextTemplateFile : NSObject
|
||||||
|
{
|
||||||
|
NSString *_textTemplate;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ (id) textTemplateFromFile: (NSString *) file;
|
||||||
|
|
||||||
|
- (id) initFromFile: (NSString *) file
|
||||||
|
withEncoding: (NSStringEncoding) enc;
|
||||||
|
|
||||||
|
- (NSString *) textForUser: (SOGoUser *) user;
|
||||||
|
|
||||||
|
@end
|
||||||
|
|
||||||
|
#endif /* SOGOTEXTTEMPLATEFILE_H */
|
|
@ -0,0 +1,104 @@
|
||||||
|
/* SOGoTextTemplateFile.m - this file is part of SOGo
|
||||||
|
*
|
||||||
|
* Copyright (C) 2016 Inverse inc.
|
||||||
|
*
|
||||||
|
* This file is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2, or (at your option)
|
||||||
|
* any later version.
|
||||||
|
*
|
||||||
|
* This file is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; see the file COPYING. If not, write to
|
||||||
|
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
* Boston, MA 02111-1307, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#import <Foundation/NSData.h>
|
||||||
|
#import <Foundation/NSValue.h>
|
||||||
|
|
||||||
|
#import "NSDictionary+Utilities.h"
|
||||||
|
#import "SOGoUser.h"
|
||||||
|
#import "SOGoUserDefaults.h"
|
||||||
|
|
||||||
|
#import "SOGoTextTemplateFile.h"
|
||||||
|
|
||||||
|
@implementation SOGoTextTemplateFile
|
||||||
|
|
||||||
|
+ (id) textTemplateFromFile: (NSString *) file
|
||||||
|
{
|
||||||
|
SOGoTextTemplateFile *newTemplate;
|
||||||
|
newTemplate = [[self alloc] initFromFile: file
|
||||||
|
withEncoding: NSUTF8StringEncoding];
|
||||||
|
[newTemplate autorelease];
|
||||||
|
return newTemplate;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
- (id) init
|
||||||
|
{
|
||||||
|
if ((self = [super init]))
|
||||||
|
{
|
||||||
|
_textTemplate = nil;
|
||||||
|
}
|
||||||
|
return self;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void) dealloc
|
||||||
|
{
|
||||||
|
[_textTemplate release];
|
||||||
|
[super dealloc];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (id) initFromFile: (NSString *) file
|
||||||
|
withEncoding: (NSStringEncoding) enc
|
||||||
|
{
|
||||||
|
id ret;
|
||||||
|
NSData *textTemplateData;
|
||||||
|
|
||||||
|
ret = nil;
|
||||||
|
if (file)
|
||||||
|
{
|
||||||
|
if ((self = [self init]))
|
||||||
|
{
|
||||||
|
textTemplateData = [NSData dataWithContentsOfFile: file];
|
||||||
|
if (textTemplateData == nil)
|
||||||
|
NSLog(@"Failed to load text template file: %@", file);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_textTemplate = [[[NSString alloc] initWithData: textTemplateData
|
||||||
|
encoding: enc] retain];
|
||||||
|
ret = self;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *) textForUser: (SOGoUser *) user
|
||||||
|
{
|
||||||
|
NSDictionary *values, *variables;
|
||||||
|
NSNumber *days;
|
||||||
|
SOGoUserDefaults* ud;
|
||||||
|
|
||||||
|
// username
|
||||||
|
ud = [user userDefaults];
|
||||||
|
|
||||||
|
// daysBetweenResponse
|
||||||
|
values = [ud vacationOptions];
|
||||||
|
days = [values objectForKey: @"daysBetweenResponse"];
|
||||||
|
if ([days intValue] == 0)
|
||||||
|
days = [NSNumber numberWithInt: 7];
|
||||||
|
|
||||||
|
variables = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||||
|
[user cn], @"username",
|
||||||
|
days, @"daysBetweenResponse", nil];
|
||||||
|
|
||||||
|
return [variables keysWithFormat: _textTemplate];
|
||||||
|
}
|
||||||
|
|
||||||
|
@end
|
|
@ -57,6 +57,7 @@
|
||||||
|
|
||||||
- (BOOL) _isSieveServerAvailable;
|
- (BOOL) _isSieveServerAvailable;
|
||||||
- (id) _sieveClient;
|
- (id) _sieveClient;
|
||||||
|
- (NSString *) _vacationTextForTemplate: (NSString *) templateFilePath;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,7 @@
|
||||||
#import <SOGo/SOGoSystemDefaults.h>
|
#import <SOGo/SOGoSystemDefaults.h>
|
||||||
#import <SOGo/SOGoUserFolder.h>
|
#import <SOGo/SOGoUserFolder.h>
|
||||||
#import <SOGo/SOGoParentFolder.h>
|
#import <SOGo/SOGoParentFolder.h>
|
||||||
|
#import <SOGo/SOGoTextTemplateFile.h>
|
||||||
#import <SOGo/WOResourceManager+SOGo.h>
|
#import <SOGo/WOResourceManager+SOGo.h>
|
||||||
#import <SOGo/SOGoBuild.h>
|
#import <SOGo/SOGoBuild.h>
|
||||||
#import <Mailer/SOGoMailAccount.h>
|
#import <Mailer/SOGoMailAccount.h>
|
||||||
|
@ -1103,6 +1104,40 @@ static NSArray *reminderValues = nil;
|
||||||
return [[user domainDefaults] vacationEnabled];
|
return [[user domainDefaults] vacationEnabled];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (NSString *) vacationHeader
|
||||||
|
{
|
||||||
|
NSString *path;
|
||||||
|
|
||||||
|
path = [[user domainDefaults] vacationHeaderTemplateFile];
|
||||||
|
|
||||||
|
return [self _vacationTextForTemplate: path];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *) vacationFooter
|
||||||
|
{
|
||||||
|
NSString *path;
|
||||||
|
|
||||||
|
path = [[user domainDefaults] vacationFooterTemplateFile];
|
||||||
|
|
||||||
|
return [self _vacationTextForTemplate: path];
|
||||||
|
}
|
||||||
|
|
||||||
|
- (NSString *) _vacationTextForTemplate: (NSString *) templateFilePath
|
||||||
|
{
|
||||||
|
NSString *text;
|
||||||
|
SOGoTextTemplateFile *templateFile;
|
||||||
|
|
||||||
|
text = nil;
|
||||||
|
if (templateFilePath)
|
||||||
|
{
|
||||||
|
templateFile = [SOGoTextTemplateFile textTemplateFromFile: templateFilePath];
|
||||||
|
if (templateFile)
|
||||||
|
text = [templateFile textForUser: user];
|
||||||
|
}
|
||||||
|
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
|
||||||
// - (void) setSieveFiltersValue: (NSString *) newValue
|
// - (void) setSieveFiltersValue: (NSString *) newValue
|
||||||
// {
|
// {
|
||||||
// sieveFilters = [newValue objectFromJSONString];
|
// sieveFilters = [newValue objectFromJSONString];
|
||||||
|
|
|
@ -820,9 +820,15 @@
|
||||||
<div layout="column" flex-offset="5" ng-show="app.preferences.defaults.Vacation.enabled == 1">
|
<div layout="column" flex-offset="5" ng-show="app.preferences.defaults.Vacation.enabled == 1">
|
||||||
<md-input-container class="md-block md-flex">
|
<md-input-container class="md-block md-flex">
|
||||||
<label><var:string label:value="Auto reply message"/></label>
|
<label><var:string label:value="Auto reply message"/></label>
|
||||||
|
<var:if condition="vacationHeader.length">
|
||||||
|
<p class="text-preview" md-colors="::{color: 'default-background-600'}"><var:string value="vacationHeader"/></p>
|
||||||
|
</var:if>
|
||||||
<textarea const:name="autoReplyText"
|
<textarea const:name="autoReplyText"
|
||||||
const:id="autoReplyText"
|
const:id="autoReplyText"
|
||||||
ng-model="app.preferences.defaults.Vacation.autoReplyText"/>
|
ng-model="app.preferences.defaults.Vacation.autoReplyText"/>
|
||||||
|
<var:if condition="vacationFooter.length">
|
||||||
|
<p class="text-preview" md-colors="::{color: 'default-background-600'}"><var:string value="vacationFooter"/></p>
|
||||||
|
</var:if>
|
||||||
</md-input-container>
|
</md-input-container>
|
||||||
|
|
||||||
<div layout="row" layout-align="start center">
|
<div layout="row" layout-align="start center">
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
/// PreferencesUI.scss -*- Mode: scss; indent-tabs-mode: nil; basic-offset: 2 -*-
|
||||||
|
|
||||||
|
.text-preview {
|
||||||
|
white-space: pre-wrap;
|
||||||
|
word-wrap: break-word;
|
||||||
|
}
|
|
@ -5,6 +5,7 @@
|
||||||
@import 'ContactsUI.scss';
|
@import 'ContactsUI.scss';
|
||||||
@import 'MessageEditorUI';
|
@import 'MessageEditorUI';
|
||||||
@import 'SchedulerUI';
|
@import 'SchedulerUI';
|
||||||
|
@import 'PreferencesUI';
|
||||||
@import 'AdministrationUI';
|
@import 'AdministrationUI';
|
||||||
|
|
||||||
.view[layout=row],
|
.view[layout=row],
|
||||||
|
|
Loading…
Reference in New Issue