Can't import contacts with import_rfc.py



  • 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 :)


  • Kopano

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



  • 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





  • 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”


  • Kopano

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



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


Log in to reply