Page 1 of 4 123 ... LastLast
Results 1 to 10 of 33

Thread: Zimlet to clear AutoComplete cache for user ?

  1. #1
    Join Date
    Oct 2009
    Location
    Dublin, IRELAND
    Posts
    712
    Rep Power
    7

    Question Zimlet to clear AutoComplete cache for user ?

    I havbe an issue (as do many others it seems) where I had to rename the domain name of my server.

    Now, for all users who had accounts prior to the domain name changing, if they attempt to write to another user to whom they had written prior to the name change happening - AutoComplete returns two email addresses for the addressee. It returns the new one from the updated GAL and also the cached old address from the old GAL.

    I am now to Zimbra so have no experience with what can and can't be done, and am not a web programmer. However, in looking through some of the code associated with AutoComplete it seems that the file

    //depot/zcs/main/ZimbraWebClient/WebRoot/js/zimbraMail/share/model/ZmAutocomplete.js

    has a prototype function for clearing out a user's cache


    ZmAutocomplete.prototype.clearCache =
    function(type, account) {
    var acct = account || appCtxt.getActiveAccount();

    if (type) {
    this._acCache[acct.id][type] = {};
    } else {
    this._acCache[acct.id][ZmAutocomplete.AC_TYPE_CONTACT] = {};
    this._acCache[acct.id][ZmAutocomplete.AC_TYPE_LOCATION] = {};
    this._acCache[acct.id][ZmAutocomplete.AC_TYPE_EQUIPMENT] = {};
    }
    };


    Is this function complete as it stands ?

    And if it is, is there anyone out there that could encapsulate it within a Zimlet ?

    Thanks for reading.

  2. #2
    Join Date
    Feb 2007
    Location
    Portland, OR
    Posts
    1,147
    Rep Power
    10

    Default

    Are you sure it is completing from the "old GAL" (there is no such thing), and not the users "Emailed Contacts" address book?

  3. #3
    Join Date
    Oct 2009
    Location
    Dublin, IRELAND
    Posts
    712
    Rep Power
    7

    Default

    Yes. I'm sure.

    Scenario is this.

    I set up the server in test mode (parallel to our main email system) and called the domain zimbra.mycompany.com

    I set up domain masquerading so that emails going to external contacts would get SMTP headers rewritten to mycompnay.com so that return emails would not fail. I set up a test group of user accounts. Those users sent and received emails for a few weeks.

    While the domain masquerading worked OK for SMTP headers, an issue came to light when we sent out calendar invites, they still contained the internal email addresses of the invitees. This lead to the internal email addresses becoming known externally.

    To avoid this conflict, I renamed the domain to be mycompany.com within the Zimbra utilities. All users email addresses changed correctly, and I set their mail host to be zimbra.mycompany.com so that emails sent internally would go to the zimbra host rather than the original still running in parallel hail host.

    All new addressing works correctly - for both internal and external users.

    I addes a second block of users to the server.

    Again, everything is working correctly.

    However, for those users that existed prior to the domain name change, when writing email and using AutoComplete, if the addressee is one of the original zimbra users, two email addresses are thrown up.

    user@zimbra.mycompany.com and user@mycompany.com - both with the little GAL symbol beside their email address.

    I have deleted all emails sent and received, contacts, etc. from one of the user accounts, and it does not appear to matter. When that account writes an email, it still shows both the old GAL entry and the new GAL entry for the addressee.

    It seems obviuos that these email addresses are being cached somewhere - probably in some recently used email addresses cache - and this is what I would like to be able to clear out.

    Thanks

  4. #4
    Join Date
    Feb 2007
    Location
    Portland, OR
    Posts
    1,147
    Rep Power
    10

    Default

    Ok well first thing is that the clearCache function that you have mentioned is only for the local cache the web client stores (I think).

    I thought that I had seen your problem before on the forums, unfortunately it was your other thread detailing this problem. I took a look around and found this wiki entry: Zimbra Directory Service (LDAP) - Zimbra :: Wiki.

    Could you take a look at the attributes listed there on one of the accounts that shows up twice and see which one is possibly causing this?

  5. #5
    Join Date
    Oct 2009
    Location
    Dublin, IRELAND
    Posts
    712
    Rep Power
    7

    Default

    Thanks for taking a look at this for me.

    I am pretty new to LDAP - so I have no idea how to examine a user's attributes. Can you please explain exactly what you want me to do, and I will happily do it.

    Thanks.

    EDIT: Maybe I found how to search ... not entirely sure. Anyway, here's the basics of what I found for one user.

    [zimbra@zimbra openldap]$ zmprov -l ga user@zimbra.mycompany.com
    ERROR: account.NO_SUCH_ACCOUNT (no such account: user@zimbra.mycompany.com)

    [zimbra@zimbra openldap]$ zmprov -l ga user@mycompany.com
    # name user@mycompany.com
    cn: User Name
    displayName: User Name
    givenName: User
    mail: uname@mycompany.com
    mail: user.name@mycompany.come
    mail: user@mycompany.com
    mail: usern@mycompany.com
    objectClass: organizationalPerson
    objectClass: zimbraAccount
    objectClass: amavisAccount
    sn: Name
    telephoneNumber: +353-1-nnnnnnn
    uid: userid
    ...
    zimbraMailAlias: uname@mycompany.com
    zimbraMailAlias: user.name@mycompany.com
    zimbraMailAlias: user@mycompany.com
    ...
    zimbraMailDeliveryAddress: usern@mycompany.com

    zimbraMailAddress is not found.


    Other than the following two lines, there is no reference to zimbra.mycompany.com

    zimbraMailHost: zimbra.mycompany.com
    zimbraMailTransport: lmtp:zimbra.mycompany.com:7025

    So - as far as I can see it is not reading it directly from the GAL as I had suspected.

    The problem is that it seems to have cached the original GAL account information in some previously used OR recently used email address cache. It is that cache that I would like to clear out for each user.
    Last edited by liverpoolfcfan; 11-25-2009 at 09:40 AM. Reason: Found requested information

  6. #6
    Join Date
    Feb 2007
    Location
    Portland, OR
    Posts
    1,147
    Rep Power
    10

    Default

    Ok try running this as the zimbra user:
    Code:
    ldapsearch -x -H ldapi:/// -D uid=zimbra,cn=admins,cn=zimbra -w `zmlocalconfig -s ldap_root_password | cut -f3 -d" "` -b "ou=people,dc=domain,dc=com" "(|(cn=admin*)(sn=admin*)(gn=admin*)(mail=admin*)(zimbraMailDeliveryAddress=admin*)(zimbraMailAlias=admin*)(zimbraMailAddress=admin*))" dn cn sn gn mail zimbraMailDeliveryAddress zimbraMailAlias zimbraMailAddress
    Replace the "admin" with whatever you are typing in that is supposedly giving two results from the GAL, and the domain part of "ou=people,dc=domain,dc=com" with your domain. You should get results like this:
    Code:
    # extended LDIF
    #
    # LDAPv3
    # base <ou=people,dc=domain,dc=com> with scope subtree
    # filter: (|(cn=admin*)(sn=admin*)(gn=admin*)(mail=admin*)(zimbraMailDeliveryAddress=admin*)(zimbraMailAlias=admin*)(zimbraMailAddress=admin*))
    # requesting: dn cn sn gn mail zimbraMailDeliveryAddress zimbraMailAlias zimbraMailAddress
    #
    
    # admin, people, domain.com
    dn: uid=admin,ou=people,dc=domain,dc=com
    zimbraMailDeliveryAddress: admin@domain.com
    sn: admin
    mail: admin@domain.com
    mail: postmaster@domain.com
    mail: abuse@domain.com
    mail: logs@domain.com
    cn: admin
    zimbraMailAlias: postmaster@domain.com
    zimbraMailAlias: abuse@domain.com
    zimbraMailAlias: logs@domain.com
    
    # search result
    search: 2
    result: 0 Success
    
    # numResponses: 2
    # numEntries: 1

  7. #7
    Join Date
    Oct 2009
    Location
    Dublin, IRELAND
    Posts
    712
    Rep Power
    7

    Default

    I am home now (9:43pm) but will try that tomorrow.

    Please let me make sure you understand what I am saying.

    I do not believe that the GAL has two entries at this time for the user.

    I believe that prior to my renaming the domain, the then valid entry in the GAL was used to send emails, and cached somewhere. It had the small GAL contact icon beside it, where as contacts from my contacts folder did not.

    Then, I renamed the domain.

    Now, when I begin to type that person's name, I get the currently valid GAL entry in the Autocomplete list. But, I also get the old, no-longer-valid, email address. Both of these email addresses show the persons First and Last names, and they both display the little logo beside them.

    I do not believe the old email address information it is getting returned from a current GAL lookup. Nor is it coming from my contacts. I have searched both of those for any instances of that person's name and/or old email address, and cannot find the old email address anywhere.

    I believe instead that it is being remembered as a recently used email address somewhere on the system - I have no idea where.

    It is that cache/recently used address list/whatever you call it/ that I would like to find a way to clear out.

  8. #8
    Join Date
    Feb 2007
    Location
    Portland, OR
    Posts
    1,147
    Rep Power
    10

    Default

    Well the problem is that there is no such cache for the GAL (other then possibly the GAL sync account if you have set that up, but that should have been synced to the current GAL by now). The only cache that I know of that might be doing this is the "Emailed Contacts" address book, but you say the icon is from the gal, and that the contact is not in this list, so I really don't know where this could be coming from.

  9. #9
    Join Date
    Oct 2009
    Location
    Dublin, IRELAND
    Posts
    712
    Rep Power
    7

    Default

    Is there a table in the MySQL database I can search to see if some original emails to those people, that I subsequently deleted, and cleared from the Trash are still referenced in there.

  10. #10
    Join Date
    Feb 2007
    Location
    Portland, OR
    Posts
    1,147
    Rep Power
    10

    Default

    Probably, but it would not be auto completing an address from the MySQL db.

Similar Threads

  1. Replies: 6
    Last Post: 03-05-2010, 12:13 AM
  2. Replies: 21
    Last Post: 02-04-2010, 09:06 AM
  3. Samba and POSIX undeploy problem
    By catnipper in forum Zimlets
    Replies: 0
    Last Post: 09-02-2009, 10:51 AM
  4. can't you help me
    By iwan siahaan in forum Administrators
    Replies: 6
    Last Post: 12-17-2007, 05:53 PM
  5. Post instsallation problems
    By Assaf in forum Installation
    Replies: 14
    Last Post: 01-29-2007, 10:38 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •