KMail + OpenLDAP - KDE

This is a discussion on KMail + OpenLDAP - KDE ; Can KMail now find addresses in an LDAP directory? Is anyone using this combination? If so, what does a typical entry in your LDAP directory (in LDIF format) look like? Can you save from KAddressBook to your LDAP directory?...

+ Reply to Thread
Results 1 to 6 of 6

Thread: KMail + OpenLDAP

  1. KMail + OpenLDAP


    Can KMail now find addresses in an LDAP directory?

    Is anyone using this combination?
    If so, what does a typical entry in your LDAP directory
    (in LDIF format) look like?

    Can you save from KAddressBook to your LDAP directory?



  2. Re: KMail + OpenLDAP

    Timothy Murphy wrote:

    >
    > Can KMail now find addresses in an LDAP directory?
    >


    Not as far as I can see (Kmail 1.9.7 here). It looks like Kontact can search
    LDAP databases and import the results into the local address book but as I
    only have login and group details in my LDAP database I can't test this.

    > Is anyone using this combination?
    > If so, what does a typical entry in your LDAP directory
    > (in LDIF format) look like?
    >
    > Can you save from KAddressBook to your LDAP directory?


    Kontact can export to LDIF format, this may answer both questions about LDAP
    above.

    --
    Geoff Registered Linux user 196308
    Replace bitbucket with geoff to mail me.

  3. Re: KMail + OpenLDAP

    Timothy Murphy wrote:

    >
    > Can KMail now find addresses in an LDAP directory?
    >
    > Is anyone using this combination?
    > If so, what does a typical entry in your LDAP directory
    > (in LDIF format) look like?
    >
    > Can you save from KAddressBook to your LDAP directory?


    Me can nothing tell you about LDAP, but about 'filling' KAddressbook with
    data. I use the vCard-import for this. Setting/creating a vCard is very
    easy. You can create a 'big' vCard where you can store different vCards in
    one. Save the 'big'-vCard to a place the user(s) have access to and add it
    as a adressbook read-only. KAdressbook now imports it.

    I wrote a small application what exports the address-data each night from my
    SQL-db and export it as a 'big' vCard, deleting the old one before. So the
    users have allways the new Address-data from the SQL-db.

    Maybe it helps you...

    Greetings

    Hans-Martin

  4. Re: KMail + OpenLDAP

    Geoffrey Clements wrote:

    >> Can KMail now find addresses in an LDAP directory?

    >
    > Not as far as I can see (Kmail 1.9.7 here). It looks like Kontact can
    > search LDAP databases and import the results into the local address book
    > but as I only have login and group details in my LDAP database I can't
    > test this.
    >
    >> Is anyone using this combination?
    >> If so, what does a typical entry in your LDAP directory
    >> (in LDIF format) look like?
    >>
    >> Can you save from KAddressBook to your LDAP directory?

    >
    > Kontact can export to LDIF format, this may answer both questions about
    > LDAP above.


    I've tried saving in LDIF format.
    The trouble is, I can't find any OpenLDAP schema
    that understands the LDIF output.
    I have to edit it quite extensively,
    eg a typical entry in the LDIF output starts:
    dn: cn=Hughie Molloy,mail=hughie@maths.tcd.ie
    which I have to change to
    dn: cn=Hughie Molloy,ou=addressbook,dc=www,dc=gayleard,dc=com
    for my LDAP directory.

    Nb I don't really understand OpenLDAP,
    and may well be doing something stupid.

    Also I haven't been able to access the LDAP directory
    from KMail or KAddressBook.
    I've looked at the examples in the KAddressBook handbook
    at ,
    and I simply don't see the same screens on my Fedora-7 system,
    eg I see no way to enter the dn of my LDAP addressbook.

    In other words, KMail + OpenLDAP has been a complete failure for me.
    I find this sad, as I for one have a need
    for a system-wide address book
    and this seems the proper way to set that up.

    I see that the KMail handbook also claims
    that KMail can work with MySQL,
    which would be a perfectly acceptable alternative,
    as far as I am concerned.
    But I have found absolutely nothing to support this claim,
    which has been in the handbook for years.




  5. Re: KMail + OpenLDAP

    Hans-Martin Böhme wrote:

    >> Can you save from KAddressBook to your LDAP directory?

    >
    > Me can nothing tell you about LDAP, but about 'filling' KAddressbook with
    > data. I use the vCard-import for this. Setting/creating a vCard is very
    > easy. You can create a 'big' vCard where you can store different vCards in
    > one. Save the 'big'-vCard to a place the user(s) have access to and add it
    > as a adressbook read-only. KAdressbook now imports it.
    >
    > I wrote a small application what exports the address-data each night from
    > my SQL-db and export it as a 'big' vCard, deleting the old one before. So
    > the users have allways the new Address-data from the SQL-db.
    >
    > Maybe it helps you...


    That would be useful.
    I should be very interested to see your program.
    What MySQL format do you use to save vCards?
    I saw that Jabber seemed to offer something along these lines.

    It does seem that vCards are the only export/import format
    that actually works with KMail/KAddressBook,
    despite the claims that these programs work with KDAP and MySQL.

    I guess your method is not really a perfect solution,
    as you presumably have to download your address book to each machine.
    I use dovecot/IMAP to save my mail on my desktop,
    and read it from there on my laptop(s),
    and it would be nice to have a matching solution for KAddressBook.

    Basically, it should be possible to do this with OpenLDAP,
    but if it is I have been unable to find the way.





  6. Re: KMail + OpenLDAP

    Timothy Murphy wrote:

    >...
    >> I wrote a small application what exports the address-data each night from
    >> my SQL-db and export it as a 'big' vCard, deleting the old one before. So
    >> the users have allways the new Address-data from the SQL-db.
    >>
    >> Maybe it helps you...

    >
    > That would be useful.
    > I should be very interested to see your program.


    My application is written in gambas2, a fine RAD-Tool for Linux.
    I sniped out the main part of the program.
    It looks like that (the >8 is a claw shows you the start/end of the
    code-snippet...):

    >8 >8 >8 >8 >8 >8 >8 >8 >8 >8 >8 >8 >8 >8 >8 >8 >8 >8 >8 >8 >8 >8 >8 >8

    'open a connection to the MySQL-db and so on...

    'Set the right character-set
    rData = MyConn.Exec("SET NAMES latin1")

    'the select with all needed fields
    rData = MyConn.Exec("SELECT needed_fields FROM table_or_view")

    'if select gives results
    IF rData.Count > 0 THEN
    'go through the sql-cursor
    FOR EACH rData.Fields
    'set SQL-cursor position
    rData.MoveTo(rDZ)

    'here we go: create the vCard-entry for each line the select finds
    vCard = vCard & "BEGIN:VCARD\n" & "CLASS:PUBLIC\n"
    vCard = vCard & "FN:" & rData!name & "\n" & "N:" & rData!partner_name
    & ";;;;"
    IF rData!sex = 0 THEN
    vCard = vCard & "\n" & "NAME:" & "Frau " & rData!name
    ELSE
    vCard = vCard & "\n" & "NAME:" & "Herr " & rData!name
    ENDIF
    vCard = vCard & "\n" & "EMAIL:" & rData!email
    vCard = vCard & "\n" & "ADR;TYPE=home:" & rData!pf & ";" &
    rData!plz_pf & ";" & rData!strasse & ";" & rData!ort & ";;" & rData!plz
    & ";" & rData!land
    vCard = vCard & "\n" & "ADR;TYPE=work:" & rData!anschrift_pf & ";" &
    rData!anschrift_plz_pf & ";" & rData!anschrift_strasse & ";" &
    rData!anschrift_ort & ";;" & rData!anschrift_plz & ";" &
    rData!anschrift_land
    vCard = vCard & "\n" & "ORG:" & rData!name1
    vCard = vCard & "\n" & "ROLE:" & rData!funktion
    vCard = vCard & "\n" & "TEL;TYPE=HOME:" & rData!telefon
    vCard = vCard & "\n" & "TEL;TYPE=WORK:" &
    rData!anschrift_telefonzentrale
    vCard = vCard & "\n" & "TEL;TYPE=CELL:" & rData!mobil
    vCard = vCard & "\n" & "URL:" & rData!anschrift_www

    vCard = vCard & "\n" & "END:VCARD\n\n\n"

    rDZ += 1
    NEXT
    ENDIF

    'close the connection
    MyConn.Close

    'save the 'Big'vCard
    File.Save("/nfs_export/vcardexport.vcf", vCard)
    >8 >8 >8 >8 >8 >8 >8 >8 >8 >8 >8 >8 >8 >8 >8 >8 >8 >8 >8 >8 >8 >8 >8 >8




    > What MySQL format do you use to save vCards?


    As you can see, i didnt store the vCard in MySQL. I create a vCard on the
    fly from fields stored in the MySQl-db. A vCard looks like:
    BEGIN:VCARD
    CLASS:PUBLIC
    EMAIL:strogg@macron.com
    FN:Strogg
    N:Strogg;;;;
    NAME:Strogg
    TEL; TYPE = HOME: 0211 242424
    TEL; TYPE = WORK: 0211 222222
    VERSION:3.0
    END:VCARD

    Of course you can store many vCards in a big one, just add more vCards after
    the last one(BEGIN:VCARD .... END:VCARD). You can store much more data in a
    vCard. Google will help.

    > I saw that Jabber seemed to offer something along these lines.
    >
    > It does seem that vCards are the only export/import format
    > that actually works with KMail/KAddressBook,
    > despite the claims that these programs work with KDAP and MySQL.
    >
    > I guess your method is not really a perfect solution,
    > as you presumably have to download your address book to each machine.


    Thats right, its not a perfect solution. But it works so far.
    My customers are happy to get all addresses in KAddressbook and they don't
    have to type it again and again.


    Hans-Martin

+ Reply to Thread