now favor login@domain as the default email address if multiple mail: fields are specified
parent
67139ce3e3
commit
d2915add6d
1
NEWS
1
NEWS
|
@ -4,6 +4,7 @@
|
|||
Enhancements
|
||||
- support for mail prority using EAS
|
||||
- immediately delete mails from EAS clients when they are marked as deleted on the IMAP server
|
||||
- now favor login@domain as the default email address if multiple mail: fields are specified
|
||||
|
||||
Bug fixes
|
||||
- fixed login issue after password change (#2601)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright (C) 2006-2013 Inverse inc.
|
||||
Copyright (C) 2006-2015 Inverse inc.
|
||||
Copyright (C) 2005 SKYRIX Software AG
|
||||
|
||||
This file is part of SOGo.
|
||||
|
|
|
@ -235,7 +235,6 @@
|
|||
[currentPassword release];
|
||||
[cn release];
|
||||
[loginInDomain release];
|
||||
//[language release];
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
|
@ -578,13 +577,13 @@
|
|||
- (void) _appendSystemMailAccount
|
||||
{
|
||||
NSString *fullName, *replyTo, *imapLogin, *imapServer, *cImapServer, *signature,
|
||||
*encryption, *scheme, *action, *query, *customEmail, *sieveServer;
|
||||
*encryption, *scheme, *action, *query, *customEmail, *defaultEmail, *sieveServer;
|
||||
NSMutableDictionary *mailAccount, *identity, *mailboxes, *receipts;
|
||||
NSNumber *port;
|
||||
NSMutableArray *identities;
|
||||
NSArray *mails;
|
||||
NSURL *url, *cUrl;
|
||||
unsigned int count, max;
|
||||
unsigned int count, max, default_identity;
|
||||
NSInteger defaultPort;
|
||||
|
||||
[self userDefaults];
|
||||
|
@ -662,8 +661,9 @@
|
|||
[mailAccount setObject: sieveServer forKey: @"sieveServerName"];
|
||||
}
|
||||
|
||||
|
||||
/* identities */
|
||||
// Identities
|
||||
defaultEmail = [NSString stringWithFormat: @"%@@%@", [self loginInDomain], [self domain]];
|
||||
default_identity = 0;
|
||||
identities = [NSMutableArray new];
|
||||
mails = [self allEmails];
|
||||
[mailAccount setObject: [mails objectAtIndex: 0] forKey: @"name"];
|
||||
|
@ -703,6 +703,10 @@
|
|||
if (signature)
|
||||
[identity setObject: signature forKey: @"signature"];
|
||||
[identities addObject: identity];
|
||||
|
||||
if ([[identity objectForKey: @"email"] caseInsensitiveCompare: defaultEmail] == NSOrderedSame)
|
||||
default_identity = [identities count]-1;
|
||||
|
||||
[identity release];
|
||||
}
|
||||
}
|
||||
|
@ -724,10 +728,14 @@
|
|||
if (signature)
|
||||
[identity setObject: signature forKey: @"signature"];
|
||||
[identities addObject: identity];
|
||||
|
||||
if ([[identity objectForKey: @"email"] caseInsensitiveCompare: defaultEmail] == NSOrderedSame)
|
||||
default_identity = [identities count]-1;
|
||||
|
||||
[identity release];
|
||||
}
|
||||
[[identities objectAtIndex: 0] setObject: [NSNumber numberWithBool: YES]
|
||||
forKey: @"isDefault"];
|
||||
[[identities objectAtIndex: default_identity] setObject: [NSNumber numberWithBool: YES]
|
||||
forKey: @"isDefault"];
|
||||
|
||||
[mailAccount setObject: identities forKey: @"identities"];
|
||||
[identities release];
|
||||
|
|
Loading…
Reference in New Issue