View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001172 | SOGo | Backend General | public | 2011-03-06 23:55 | 2011-03-06 23:55 |
Reporter | birger | Assigned To | |||
Priority | normal | Severity | trivial | Reproducibility | have not tried |
Status | new | Resolution | open | ||
Product Version | 1.3.5 | ||||
Summary | 0001172: Default email address is always added | ||||
Description | -[SOGoUserManager _fillContactMailRecords:] always adds a default system email address (uid@domain, or just uid if it contains an @) to a user's list of emails. The place where this code is called a comment says At my site users don't necessarily have an email address which is the same as the uid. This in combination with iCal led to problems where this default email address was used by iCal as sender address for meeting invitations. Attached is a patch which changes _fillContactMailRecords to only add the default email address in case the list of emails of the contact is empty. | ||||
Tags | No tags attached. | ||||
2011-03-06 23:55
|
patch (1,306 bytes)
--- SoObjects/SOGo/SOGoUserManager.m.bak 2011-03-07 00:09:04.000000000 +0100 +++ SoObjects/SOGo/SOGoUserManager.m 2011-03-07 00:15:44.000000000 +0100 @@ -523,19 +523,22 @@ NSMutableArray *emails; SOGoDomainDefaults *dd; - domain = [contact objectForKey: @"c_domain"]; - if ([domain length]) - dd = [SOGoDomainDefaults defaultsForDomain: domain]; - else - dd = [SOGoSystemDefaults sharedSystemDefaults]; emails = [contact objectForKey: @"emails"]; - uid = [contact objectForKey: @"c_uid"]; - if ([uid rangeOfString: @"@"].location == NSNotFound) - systemEmail - = [NSString stringWithFormat: @"%@@%@", uid, [dd mailDomain]]; - else - systemEmail = uid; - [emails addObject: systemEmail]; + if ([emails count] == 0) + { + domain = [contact objectForKey: @"c_domain"]; + if ([domain length]) + dd = [SOGoDomainDefaults defaultsForDomain: domain]; + else + dd = [SOGoSystemDefaults sharedSystemDefaults]; + uid = [contact objectForKey: @"c_uid"]; + if ([uid rangeOfString: @"@"].location == NSNotFound) + systemEmail + = [NSString stringWithFormat: @"%@@%@", uid, [dd mailDomain]]; + else + systemEmail = uid; + [emails addObject: systemEmail]; + } [contact setObject: [emails objectAtIndex: 0] forKey: @"c_email"]; } |