(feat) now possible to specify which domains you can forward your mails to

This commit is contained in:
Ludovic Marcotte
2019-08-15 12:48:53 -04:00
parent f7f9cb29e0
commit 04f91b8948
8 changed files with 39 additions and 3 deletions

View File

@@ -63,6 +63,7 @@
= "Please specify an address to which you want to forward your messages.";
"You are not allowed to forward your messages to an external email address." = "You are not allowed to forward your messages to an external email address.";
"You are not allowed to forward your messages to an internal email address." = "You are not allowed to forward your messages to an internal email address.";
"You are not allowed to forward your messages to this domain:" = "You are not allowed to forward your messages to this domain:";
/* d & t */
"Current Time Zone" = "Current Time Zone";

View File

@@ -1,6 +1,6 @@
/* UIxPreferences.m - this file is part of SOGo
*
* Copyright (C) 2007-2018 Inverse inc.
* Copyright (C) 2007-2019 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
@@ -1495,6 +1495,18 @@ static NSArray *reminderValues = nil;
return [NSString stringWithFormat: @"%d", [dd forwardConstraints]];
}
- (NSString *) forwardConstraintsDomains
{
NSMutableArray *domains;
SOGoDomainDefaults *dd;
dd = [[context activeUser] domainDefaults];
domains = [NSMutableArray array];
[domains addObjectsFromArray: [dd forwardConstraintsDomains]];
return [domains jsonRepresentation];
}
//
// Used by templates
//

View File

@@ -21,6 +21,7 @@
var defaultEmailAddresses = '<var:string value="defaultEmailAddresses" const:escapeHTML="NO"/>';
var defaultCalendarCategories = <var:string value="defaultCalendarCategoriesColors" const:escapeHTML="NO"/>;
var forwardConstraints = <var:string value="forwardConstraints" const:escapeHTML="NO"/>;
var forwardConstraintsDomains = <var:string value="forwardConstraintsDomains" const:escapeHTML="NO"/>;
var sieveCapabilities = <var:string value="sieveCapabilities" const:escapeHTML="NO"/>;
</script>

View File

@@ -347,6 +347,12 @@
Dialog.alert(l('Error'), l("You are not allowed to forward your messages to an internal email address."));
sendForm = false;
}
else if ($window.forwardConstraints == 2 &&
$window.forwardConstraintsDomains.length > 0 &&
$window.forwardConstraintsDomains.indexOf(domain) < 0) {
Dialog.alert(l('Error'), l("You are not allowed to forward your messages to this domain:") + " " + domain);
sendForm = false;
}
}
}