Navigation

    Kopano
    • Register
    • Login
    • Search
    • Categories
    • Get Official Kopano Support
    • Recent
    Statement regarding the closure of the Kopano community forum and the end of the community edition

    Wrong receiver address displayed

    Kopano WebApp
    5
    19
    4959
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • hpvb
      hpvb last edited by

      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.

      hpvb 1 Reply Last reply Reply Quote 0
      • Pozzo-Balbi
        Pozzo-Balbi last edited by

        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

        0_1491837611821_Screenshot at 2017-04-10 17-47-59.png

        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

        1 Reply Last reply Reply Quote 0
        • hpvb
          hpvb @hpvb last edited by

          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?

          fbartels 1 Reply Last reply Reply Quote 0
          • fbartels
            fbartels Kopano @hpvb last edited by

            @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.

            Regards Felix

            Resources:
            https://kopano.com/blog/how-to-get-kopano/
            https://documentation.kopano.io/
            https://kb.kopano.io/

            Support overview:
            https://kopano.com/support/

            1 Reply Last reply Reply Quote 0
            • hpvb
              hpvb last edited by

              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.

              1 Reply Last reply Reply Quote 0
              • hpvb
                hpvb last edited by hpvb

                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,
                
                fbartels 1 Reply Last reply Reply Quote 0
                • fbartels
                  fbartels Kopano @hpvb last edited by

                  @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

                  Regards Felix

                  Resources:
                  https://kopano.com/blog/how-to-get-kopano/
                  https://documentation.kopano.io/
                  https://kb.kopano.io/

                  Support overview:
                  https://kopano.com/support/

                  1 Reply Last reply Reply Quote 0
                  • hpvb
                    hpvb last edited by

                    @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.

                    fbartels 1 Reply Last reply Reply Quote 0
                    • fbartels
                      fbartels Kopano @hpvb last edited by

                      @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.

                      Regards Felix

                      Resources:
                      https://kopano.com/blog/how-to-get-kopano/
                      https://documentation.kopano.io/
                      https://kb.kopano.io/

                      Support overview:
                      https://kopano.com/support/

                      1 Reply Last reply Reply Quote 0
                      • hpvb
                        hpvb last edited by hpvb

                        @fbartels Does this look OK to you?
                        https://notabug.org/hp/kopano-dagent-rewritegaladdresses

                        If so I’ll add it to that wiki page.

                        fbartels 1 Reply Last reply Reply Quote 0
                        • fbartels
                          fbartels Kopano @hpvb last edited by

                          @hpvb did not test your script, but the description reads fine for me. Thanks for making a repository for it.

                          Regards Felix

                          Resources:
                          https://kopano.com/blog/how-to-get-kopano/
                          https://documentation.kopano.io/
                          https://kb.kopano.io/

                          Support overview:
                          https://kopano.com/support/

                          1 Reply Last reply Reply Quote 0
                          • hpvb
                            hpvb last edited by

                            I’ve sent a PR for that repository. Thanks for your feedback.

                            1 Reply Last reply Reply Quote 1
                            • Pozzo-Balbi
                              Pozzo-Balbi last edited by

                              @hpvb thanks a lot. Can’t wait for your patch to reach nightly builds.

                              1 Reply Last reply Reply Quote 0
                              • hpvb
                                hpvb last edited by

                                @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.

                                1 Reply Last reply Reply Quote 0
                                • mnewman
                                  mnewman last edited by

                                  Can someone please fix the Plugin. It´s not working with Python 3 in Kopano 8.7

                                  Thanks
                                  Markus

                                  1 Reply Last reply Reply Quote 0
                                  • First post
                                    Last post