Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Zimlets

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-20-2009, 10:13 AM
Elite Member
 
Posts: 420
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.
Reply With Quote
  #2 (permalink)  
Old 11-20-2009, 03:47 PM
Moderator
 
Posts: 1,147
Default

Are you sure it is completing from the "old GAL" (there is no such thing), and not the users "Emailed Contacts" address book?
Reply With Quote
  #3 (permalink)  
Old 11-23-2009, 03:11 AM
Elite Member
 
Posts: 420
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
Reply With Quote
  #4 (permalink)  
Old 11-23-2009, 12:40 PM
Moderator
 
Posts: 1,147
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?
Reply With Quote
  #5 (permalink)  
Old 11-25-2009, 08:43 AM
Elite Member
 
Posts: 420
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 10:40 AM.. Reason: Found requested information
Reply With Quote
  #6 (permalink)  
Old 11-25-2009, 12:19 PM
Moderator
 
Posts: 1,147
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
Reply With Quote
  #7 (permalink)  
Old 11-25-2009, 02:53 PM
Elite Member
 
Posts: 420
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.
Reply With Quote
  #8 (permalink)  
Old 11-25-2009, 02:56 PM
Moderator
 
Posts: 1,147
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.
Reply With Quote
  #9 (permalink)  
Old 11-25-2009, 03:03 PM
Elite Member
 
Posts: 420
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.
Reply With Quote
  #10 (permalink)  
Old 11-25-2009, 03:04 PM
Moderator
 
Posts: 1,147
Default

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.