New domain preference: SOGoIMAPCASServiceName

Set this to the service name expected by the CAS server if it differs
from SOGoIMAPServer. This is useful to request a CAS ticket for service
imap://imap.domain.com while connecting through imapproxy on imap://127.0.0.1:1143

SOGoDAVAuthenticator is not updated since it doesn't really use the imap code.
This commit is contained in:
Jean Raby committed 2013-06-18 16:36:11 -04:00
1 parent f24e3a0a31
commit 0fb006c19f
3 files changed
+19 -7

No files matched your search

+1
View File
@@ -43,6 +43,7 @@
- (NSString *) mailDomain; - (NSString *) mailDomain;
- (NSString *) imapServer; - (NSString *) imapServer;
- (NSString *) sieveServer; - (NSString *) sieveServer;
- (NSString *) imapCASServiceName;
- (NSString *) imapAclStyle; - (NSString *) imapAclStyle;
- (NSString *) imapAclGroupIdPrefix; - (NSString *) imapAclGroupIdPrefix;
- (NSString *) imapFolderSeparator; - (NSString *) imapFolderSeparator;
+5
View File
@@ -123,6 +123,11 @@
return [self stringForKey: @"SOGoSieveServer"]; return [self stringForKey: @"SOGoSieveServer"];
} }
- (NSString *) imapCASServiceName
{
return [self objectForKey: @"SOGoIMAPCASServiceName"];
}
#warning should be removed when we make use of imap namespace #warning should be removed when we make use of imap namespace
- (NSString *) imapAclStyle - (NSString *) imapAclStyle
{ {
+13 -7
View File
@@ -269,12 +269,13 @@
forceRenew: (BOOL) renew forceRenew: (BOOL) renew
{ {
NSString *authType, *password; NSString *authType, *password;
SOGoSystemDefaults *sd;
password = [self passwordInContext: context]; password = [self passwordInContext: context];
if ([password length]) if ([password length])
{ {
authType = [[SOGoSystemDefaults sharedSystemDefaults] sd = [SOGoSystemDefaults sharedSystemDefaults];
authenticationType]; authType = [sd authenticationType];
if ([authType isEqualToString: @"cas"]) if ([authType isEqualToString: @"cas"])
{ {
SOGoCASSession *session; SOGoCASSession *session;
@@ -283,13 +284,18 @@
session = [SOGoCASSession CASSessionWithIdentifier: password session = [SOGoCASSession CASSessionWithIdentifier: password
fromProxy: NO]; fromProxy: NO];
// We must NOT assume the scheme exists service = [sd imapCASServiceName]; // try configured service first
scheme = [server scheme]; if (!service)
{
// We must NOT assume the scheme exists
scheme = [server scheme];
if (!scheme) if (!scheme)
scheme = @"imap"; scheme = @"imap";
service = [NSString stringWithFormat: @"%@://%@", scheme, [server host]]; service = [NSString stringWithFormat: @"%@://%@",
scheme, [server host]];
}
if (renew) if (renew)
[session invalidateTicketForService: service]; [session invalidateTicketForService: service];