Zimlet to clear AutoComplete cache for user ?

Interested in talking about Mash-up's? This is the place.
liverpoolfcfan
Outstanding Member
Outstanding Member
Posts: 934
Joined: Sat Sep 13, 2014 12:47 am

Zimlet to clear AutoComplete cache for user ?

Postby liverpoolfcfan » Fri Nov 20, 2009 11:13 am

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.


ArcaneMagus
Elite member
Elite member
Posts: 1138
Joined: Fri Sep 12, 2014 10:25 pm

Zimlet to clear AutoComplete cache for user ?

Postby ArcaneMagus » Fri Nov 20, 2009 4:47 pm

Are you sure it is completing from the "old GAL" (there is no such thing), and not the users "Emailed Contacts" address book?
liverpoolfcfan
Outstanding Member
Outstanding Member
Posts: 934
Joined: Sat Sep 13, 2014 12:47 am

Zimlet to clear AutoComplete cache for user ?

Postby liverpoolfcfan » Mon Nov 23, 2009 4:11 am

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
ArcaneMagus
Elite member
Elite member
Posts: 1138
Joined: Fri Sep 12, 2014 10:25 pm

Zimlet to clear AutoComplete cache for user ?

Postby ArcaneMagus » Mon Nov 23, 2009 1:40 pm

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?
liverpoolfcfan
Outstanding Member
Outstanding Member
Posts: 934
Joined: Sat Sep 13, 2014 12:47 am

Zimlet to clear AutoComplete cache for user ?

Postby liverpoolfcfan » Wed Nov 25, 2009 9:43 am

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.
ArcaneMagus
Elite member
Elite member
Posts: 1138
Joined: Fri Sep 12, 2014 10:25 pm

Zimlet to clear AutoComplete cache for user ?

Postby ArcaneMagus » Wed Nov 25, 2009 1:19 pm

Ok try running this as the zimbra user:

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:

# extended LDIF

#

# LDAPv3

# base 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
liverpoolfcfan
Outstanding Member
Outstanding Member
Posts: 934
Joined: Sat Sep 13, 2014 12:47 am

Zimlet to clear AutoComplete cache for user ?

Postby liverpoolfcfan » Wed Nov 25, 2009 3:53 pm

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.
ArcaneMagus
Elite member
Elite member
Posts: 1138
Joined: Fri Sep 12, 2014 10:25 pm

Zimlet to clear AutoComplete cache for user ?

Postby ArcaneMagus » Wed Nov 25, 2009 3:56 pm

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.
liverpoolfcfan
Outstanding Member
Outstanding Member
Posts: 934
Joined: Sat Sep 13, 2014 12:47 am

Zimlet to clear AutoComplete cache for user ?

Postby liverpoolfcfan » Wed Nov 25, 2009 4:03 pm

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.
ArcaneMagus
Elite member
Elite member
Posts: 1138
Joined: Fri Sep 12, 2014 10:25 pm

Zimlet to clear AutoComplete cache for user ?

Postby ArcaneMagus » Wed Nov 25, 2009 4:04 pm

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

Return to “Zimlets”

Who is online

Users browsing this forum: No registered users and 2 guests