Wrong receiver address displayed
-
This is a problem for me too. For the moment I’ve included @h44z 's plugin to my installation as well but an option in dagent or webapp to disable this behaviour would be very much appreciated by me.
-
Hi,
a Webapp plugin does not solve the problem. Emails synced via z-push still have wrong email, same goes for IMAP sync. Further the “sed -i” of kopano-dagent also works on attached emails (sic!). See picture
See post https://forums.zarafa.com/showthread.php?13528-Zarafa-Kopano-replace-alias-emails-with-email-of-user&p=58359&viewfull=1#post58359 for full problem explanation.
Last but not least, to prove that it is a bug and not a feature, I have use of GAB disabled where possible (e.g. server.cfg: enable_gab = no). I use ldap plugin.A kopano-dagent setting to disable this behaviour would be greatly appreciated.
Thanks
-
Yeah, I just noticed that the problem still appears on mobile/zpush. I’m probably just going to patch this out of dagent myself, and put it behind a config option. I can submit a patch/pull request to the kopano source tree if you guys take code?
-
@hpvb said in Wrong receiver address displayed:
I can submit a patch/pull request to the kopano source tree if you guys take code?
Sure, patches are welcome! You can find the contributing information at https://stash.kopano.io/projects/KC/repos/kopanocore/browse/CONTRIBUTING.md and as long as you make this behavior optional and non-default I don’t see a problem with it.
-
OK, I’m working on a patch but it’s a little harder than I thought. It seems there’s no explicit point in the code where this happens. I was looking in ResolveUsers() but I don’t think that’s it.
-
I actually ended up writing a DAgent plugin for this. This was way easier and a little easier for me to manage with regards to upgrades. It’d be nice if there were srpms for the open source packages :)
This does only partially fix the problem though: From headers are still rewritten which is very confusing too :)
Maybe this shows what my/our problem is though. I don’t know how much work it’d be to do this in DAgent directly.
import MAPI import email from email.utils import getaddresses from MAPI.Util import * from plugintemplates import * class RewriteUsers(IMapiDAgentPlugin): def __init__(self, logger): IMapiDAgentPlugin.__init__(self, logger) def PreDelivery(self, session, addrbook, store, folder, message): headers = message.GetProps([PR_TRANSPORT_MESSAGE_HEADERS], 0)[0].Value msg = email.message_from_string(headers) to_addrs = getaddresses(msg.get_all('to', [])) cc_addrs = getaddresses(msg.get_all('cc', [])) names = [] for addr in to_addrs: names.append([ SPropValue(PR_RECIPIENT_TYPE, MAPI_TO), SPropValue(PR_DISPLAY_NAME_W, unicode(addr[0])), SPropValue(PR_ADDRTYPE, 'SMTP'), SPropValue(PR_EMAIL_ADDRESS, unicode(addr[1])), ]) for addr in cc_addrs: names.append([ SPropValue(PR_RECIPIENT_TYPE, MAPI_CC), SPropValue(PR_DISPLAY_NAME_W, unicode(addr[0])), SPropValue(PR_ADDRTYPE, 'SMTP'), SPropValue(PR_EMAIL_ADDRESS, unicode(addr[1])), ]) message.ModifyRecipients(0, names) return MP_CONTINUE,
-
@hpvb thanks for posting the plugin. If you add some documentation and add upload it somewhere (be for example in a gist at Github), then you could also add it to https://stash.z-hub.io/projects/COM/repos/projects-and-resources/browse#Kopano-dAgent-Spooler-Plugins
-
@fbartels sure, I’ll setup a repository for it and add some documentation. This may be useful for others besides just me and the other two people in this thread.
-
@hpvb great. if you need any assistance let me know. If you don’t want to create a Github/Whatever account, then you could also create a personal git repo on stash.z-hub.io.
-
@fbartels Does this look OK to you?
https://notabug.org/hp/kopano-dagent-rewritegaladdressesIf so I’ll add it to that wiki page.
-
@hpvb did not test your script, but the description reads fine for me. Thanks for making a repository for it.
-
I’ve sent a PR for that repository. Thanks for your feedback.
-
@hpvb thanks a lot. Can’t wait for your patch to reach nightly builds.
-
@Pozzo-Balbi I didn’t end up writing a patch for dagent, but a plugin for dagent. You can get it here : https://notabug.org/hp/kopano-dagent-rewritegaladdresses. Once that is installed everything should start working. I’ve had it running for 5 days now without issue.
-
Can someone please fix the Plugin. It´s not working with Python 3 in Kopano 8.7
Thanks
Markus