mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-03-02 13:46:23 +00:00
feat(mail): add options to not add X-Foward header in mail
This commit is contained in:
@@ -530,6 +530,10 @@ This could be `America/New_York`, `Europe/Berlin`, `Asia/Tokyo` or
|
||||
|
||||
In our example, we set the time zone to `America/Montreal`.
|
||||
|
||||
|D |SOGoMailDisableXForward
|
||||
|Parameter used to prevent sogo from adding the mail header X-Forward that
|
||||
contains the user ip. Set to 'YES' to disable this header. Default to 'NO'.
|
||||
|
||||
|D |SOGoMailDomain
|
||||
|Parameter used to set the default domain name used by SOGo. SOGo uses
|
||||
this parameter to build the list of valid email addresses for users.
|
||||
|
||||
@@ -1838,6 +1838,7 @@ static NSString *userAgent = nil;
|
||||
NSString *s, *dateString;
|
||||
NGMutableHashMap *map;
|
||||
id emails, from, replyTo;
|
||||
BOOL addXForward = NO;
|
||||
|
||||
map = [[[NGMutableHashMap alloc] initWithCapacity:16] autorelease];
|
||||
|
||||
@@ -1884,16 +1885,14 @@ static NSString *userAgent = nil;
|
||||
[map addObject: userAgent forKey: @"User-Agent"];
|
||||
|
||||
/* add custom headers */
|
||||
if ([(s = [[context request] headerForKey:@"x-webobjects-remote-host"]) length] > 0 &&
|
||||
addXForward = ![[[context activeUser] domainDefaults] mailDisableXForward];
|
||||
if (addXForward && [(s = [[context request] headerForKey:@"x-webobjects-remote-host"]) length] > 0 &&
|
||||
[s compare: @"localhost"] != NSOrderedSame)
|
||||
[map addObject: s
|
||||
forKey: @"X-Forward"];
|
||||
[map addObject: s forKey: @"X-Forward"];
|
||||
if ([(s = [headers objectForKey: @"X-Priority"]) length] > 0)
|
||||
[map setObject: s
|
||||
forKey: @"X-Priority"];
|
||||
[map setObject: s forKey: @"X-Priority"];
|
||||
if ([(s = [headers objectForKey: @"Disposition-Notification-To"]) length] > 0)
|
||||
[map setObject: s
|
||||
forKey: @"Disposition-Notification-To"];
|
||||
[map setObject: s forKey: @"Disposition-Notification-To"];
|
||||
|
||||
[self _addHeaders: _headers toHeaderMap: map];
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
- (BOOL) mailCustomFromEnabled;
|
||||
- (BOOL) mailAuxiliaryUserAccountsEnabled;
|
||||
|
||||
- (BOOL) mailDisableXForward;
|
||||
- (NSString *) mailDomain;
|
||||
- (NSString *) imapServer;
|
||||
- (NSString *) sieveServer;
|
||||
|
||||
@@ -106,6 +106,11 @@
|
||||
return [self boolForKey: @"SOGoMailAuxiliaryUserAccountsEnabled"];
|
||||
}
|
||||
|
||||
- (BOOL) mailDisableXForward
|
||||
{
|
||||
return [self boolForKey: @"SOGoMailDisableXForward"];
|
||||
}
|
||||
|
||||
- (NSString *) mailDomain
|
||||
{
|
||||
return [self stringForKey: @"SOGoMailDomain"];
|
||||
|
||||
Reference in New Issue
Block a user