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

    Can't import contacts with import_rfc.py

    Kopano Groupware Core
    5
    8
    500
    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.
    • boospy
      boospy last edited by

      Hello all,

      using here Kopano with UCS 4.4.1. Kopano 8.7.1.

      I would like to import my contacts from nextcloud (vards). I have 3 vcards with about 800 contacts inside. So i would use this script. https://stash.kopano.io/projects/KC/repos/kopanocore/browse/swig/python/kopano/scripts/import_rfc.py

      But it did not work here. If i execute this command:

      import_rfc.py  -u myuser -S XXXXXXXXXXXXXXXXXXX --folder=Kontakte  contacts-2019-08-31.vcf
      

      I get this error:

      Traceback (most recent call last):
        File "/usr/local/bin/import_rfc.py", line 14, in <module>
          server = kopano.server(options, parse_args=True)
      TypeError: 'module' object is not callable
      

      Is there something missing?

      Thanks :)

      galewinston 1 Reply Last reply Reply Quote 0
      • longsleep
        longsleep Kopano last edited by

        @boospy said in Can't import contacts with import_rfc.py:

        Is there something missing?

        Yes - you use a script from “master” branch while using Kopano 8.7 (From kc-8.7.x branch). There are some changes in the Kopano module for Python in master. So either use the script from the branch matching your Kopano installation or update your Kopano installation to the version where the script came from.

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

          This day i bought a subscription, i updated the system. But the script does not work. Where i can download things like that script for my version (8.7.5). I’ve imported the contacts already over Android. But with this method, after i save the contact once in kopano the quality of the contactpicture is gone away. If i set the same picture once again with kopano, the quality is ok again. But really there are many 100 of contacts to edit…

          Thanks

          externa1 1 Reply Last reply Reply Quote 0
          • externa1
            externa1 @boospy last edited by

            @boospy

            https://stash.kopano.io/projects/KC/repos/kopanocore/browse/swig/python/kopano/scripts/import_rfc.py?at=refs%2Fheads%2Fkc-8.7.x

            rg
            Christian

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

              Ok, i’ve imported the new script. For the first time the script did not work, because “python-kopano” was not installed. After install the packages the script would be execute. Good. But i think now something other goes wrong. What is my command:

              import_rfc.py pm-2019-09-01.vcf  -u myuser  --folder=test1 -p XXX
              
              Traceback (most recent call last):
                File "/usr/local/bin/import_rfc.py", line 30, in <module>
                  folder.create_item(vcf=data)
                File "/usr/lib/python2.7/dist-packages/kopano/folder.py", line 483, in create_item
                  item = _item.Item(self, eml=eml, ics=ics, vcf=vcf, load=load, loads=loads, attachments=attachments, create=True, save=save)
                File "/usr/lib/python2.7/dist-packages/kopano/item.py", line 201, in __init__
                  vcm.parse_vcf(vcf)
                File "/usr/lib/python2.7/dist-packages/icalmapi.py", line 211, in parse_vcf
                  return _icalmapi.vcftomapi_parse_vcf(self, ical)
              MAPI.Struct.MAPIErrorCorruptData: MAPI error 8004011B (MAPI_E_CORRUPT_DATA)
              

              So what is the right format for?
              Options:

              -s SOCKET, --server-socket=SOCKET  connect to server SOCKET
              -k FILE, --ssl-key=FILE            SSL key file
              -p PASS, --ssl-pass=PASS           SSL key password
              -u NAME, --user=NAME               Specify user
              -f NAME, --folder=NAME             Specify folder
              

              It should work, i give all that options that are necessary.

              After some tests… i’ve imported with that command “one” contact sucessfully. But without picture, and with an horrible character encoding. Like this “Möchte” German word. Should be “Möchte”

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

                @boospy said in Can't import contacts with import_rfc.py:

                So what is the right format for?

                Your problem isn’t the options you pass to the script, its your data. There is some value in there that icalmapi cannot parse.

                And I see in your edit that you have already realised that for this script to work you would need to have one contact per file.

                I would suspect that the encoding issue comes from your current shell.

                As you wrote in another thread that you bought a subscription I would recommend to get in contact with our support so that they can inspect your import data.

                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
                • boospy
                  boospy last edited by

                  @fbartels said in Can't import contacts with import_rfc.py:

                  As you wrote in another thread that you bought a subscription I would recommend to get in contact with our support so that they can inspect your import data.

                  Yes. I think that is the best idea :) Thanks anyway. I have already come a bit further.

                  1 Reply Last reply Reply Quote 0
                  • galewinston
                    galewinston @boospy last edited by

                    @boospy said in Can't import contacts with import_rfc.py:

                    Traceback (most recent call last):
                    File “/usr/local/bin/import_rfc.py”, line 14, in <module>
                    server = kopano.server(options, parse_args=True)
                    TypeError: ‘module’ object is not callable

                    This error statement TypeError: ‘module’ object is not callable is raised as you are being confused about the Class name and Module name. The problem is in the import line . You are importing a module, not a class. This happend because the module name and class name have the same name .

                    If you have a class MyClass in a file called MyClass.py , then you should write:

                    from MyClass import MyClass
                    
                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post