Dependency Graph

Dependency Graph
related to related to child of child of duplicate of duplicate of

View Issue Details

IDProjectCategoryView StatusLast Update
0000556SOGoBackend Generalpublic2011-01-05 17:34
Reportercyberal77 Assigned Toludovic  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version1.2.1 
Target Version1.3.5Fixed in Version1.3.5 
Summary0000556: Use the SQL field "mail" instead of "uid + MailDomain"
Description

maildomain as set to test.com

I have a user where :
c_uid = sogo1test
mail = mister.sogo@test.com

In webmail or when SOGo send mail "Calandar creation" the mail for my user is sogo1test@test.com instead of mister.sogo@test.com.

in my mail system sogo1test@test.com is Unknow.

TagsNo tags attached.

Relationships

has duplicate 0000888 resolvedludovic Authentication with MySQL 

Activities

2010-04-09 09:20

 

patch_sql_mail.diff (3,165 bytes)   
*** SOGo/SoObjects/SOGo/SOGoUserManager.m	2010-04-01 18:08:05.000000000 +0200
--- ../SOGo/SoObjects/SOGo/SOGoUserManager.m	2010-04-09 14:45:10.000000000 +0200
***************
*** 480,486 ****
  
  - (void) _fillContactMailRecords: (NSMutableDictionary *) contact
  {
!   NSString *uid, *domain, *systemEmail;
    NSMutableArray *emails;
    SOGoDomainDefaults *dd;
  
--- 480,486 ----
  
  - (void) _fillContactMailRecords: (NSMutableDictionary *) contact
  {
!   NSString *uid, *domain, *systemEmail, *mail;
    NSMutableArray *emails;
    SOGoDomainDefaults *dd;
  
***************
*** 491,501 ****
      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];
    [contact setObject: [emails objectAtIndex: 0] forKey: @"c_email"];
  }
--- 491,505 ----
      dd = [SOGoSystemDefaults sharedSystemDefaults];
    emails = [contact objectForKey: @"emails"];
    uid = [contact objectForKey: @"c_uid"];
!   mail = [contact objectForKey: @"mail"];
!   if (mail != nil)
!     systemEmail = mail;
!   else if ([uid rangeOfString: @"@"].location == NSNotFound)
      systemEmail
        = [NSString stringWithFormat: @"%@@%@", uid, [dd mailDomain]];
    else
      systemEmail = uid;
+   NSLog (@"EmailForContact: %@", mail);
    [emails addObject: systemEmail];
    [contact setObject: [emails objectAtIndex: 0] forKey: @"c_email"];
  }
***************
*** 507,519 ****
    NSDictionary *userEntry;
    NSEnumerator *sogoSources;
    NSObject <SOGoDNSource> *currentSource;
!   NSString *sourceID, *cn, *c_domain, *c_uid, *c_imaphostname;
    NSArray *c_emails;
    BOOL access;
  
    emails = [NSMutableArray array];
    cn = nil;
    c_uid = nil;
    c_domain = nil;
    c_imaphostname = nil;
  
--- 511,524 ----
    NSDictionary *userEntry;
    NSEnumerator *sogoSources;
    NSObject <SOGoDNSource> *currentSource;
!   NSString *sourceID, *cn, *c_domain, *c_uid, *c_email, *c_imaphostname;
    NSArray *c_emails;
    BOOL access;
  
    emails = [NSMutableArray array];
    cn = nil;
    c_uid = nil;
+   c_email = nil;
    c_domain = nil;
    c_imaphostname = nil;
  
***************
*** 534,539 ****
--- 539,546 ----
  	    cn = [userEntry objectForKey: @"c_cn"];
  	  if (!c_uid)
  	    c_uid = [userEntry objectForKey: @"c_uid"];
+ 	  if (!c_email)
+ 	    c_email = [userEntry objectForKey: @"mail"];
            if (!c_domain)
              c_domain = [userEntry objectForKey: @"c_domain"];
  	  c_emails = [userEntry objectForKey: @"c_emails"];
***************
*** 564,569 ****
--- 571,578 ----
    [currentUser setObject: emails forKey: @"emails"];
    [currentUser setObject: cn forKey: @"cn"];
    [currentUser setObject: c_uid forKey: @"c_uid"];
+   if (c_email)
+     [currentUser setObject: c_email forKey: @"mail"];
    [currentUser setObject: c_domain forKey: @"c_domain"];
  
    // If our LDAP queries gave us nothing, we add at least one default
patch_sql_mail.diff (3,165 bytes)   
cyberal77

cyberal77

2010-04-09 09:22

reporter   ~0000909

I have attached a patch that works in SQL but I do not know if it works with LDAP.

ludovic

ludovic

2010-08-03 12:11

administrator   ~0001270

The change should not be in SOGoUserManager but it should rather be in SQLSource.m.

Could you provide a new patch?

ludovic

ludovic

2010-08-03 12:19

administrator   ~0001271

"Demoted" while we wait for a new patch.

ludovic

ludovic

2011-01-05 17:34

administrator   ~0002004

See http://mtn.inverse.ca/revision/diff/d7aebce05726f8e7de4e1e755b2143939a487c9e/with/f661875c0ea83ef886f78e3b498bc05b1d105e9a

Issue History

Date Modified Username Field Change
2010-04-09 09:05 cyberal77 New Issue
2010-04-09 09:20 cyberal77 File Added: patch_sql_mail.diff
2010-04-09 09:22 cyberal77 Note Added: 0000909
2010-07-27 13:06 ludovic Status new => assigned
2010-07-27 13:06 ludovic Assigned To => ludovic
2010-07-27 13:06 ludovic Target Version => 1.3.1
2010-08-03 12:11 ludovic Note Added: 0001270
2010-08-03 12:19 ludovic Note Added: 0001271
2010-08-03 12:19 ludovic Target Version 1.3.1 =>
2010-12-29 14:57 ludovic Relationship added has duplicate 0000888
2011-01-05 15:32 ludovic Target Version => 1.3.5
2011-01-05 17:34 ludovic Note Added: 0002004
2011-01-05 17:34 ludovic Status assigned => resolved
2011-01-05 17:34 ludovic Fixed in Version => 1.3.5
2011-01-05 17:34 ludovic Resolution open => fixed