Convert webmail address book to VCard

If you have a program or script that you'd like to give away or sell, this is the place to do it. All offers should include contact info.

Moderators: BBear, theunknownhost, flaguy

Post Reply
User avatar
Sapphyre
Official Test Penquin
Posts: 3337
Joined: Tue Nov 19, 2002 2:50 am
Location: Canada

Convert webmail address book to VCard

Post by Sapphyre » Wed Mar 04, 2015 3:12 pm

Here's a one liner for you - will convert the old style openwebmail db address book into Vcard (.vcf) format.
I found some books were not converted automatically when the format used by openwebmail changed.
VCard format may also be needed if you are moving to an alternate webmail client

Code: Select all

cat .address.book.old|cut -d' ' -f2-|sed 's/cn=/BEGIN:VCARD\'$'\n''FN:/g'|sed 's/@@@mail=/\'$'\n''EMAIL:/g'|sed 's/@@@$/\'$'\n''END:VCARD\'$'\n''/g' >> addressbook.vcf
This will change this format:
dn cn=@@@mail=joykyc@bexxxet.tld@@@
dn cn='Karen & Phil Scott'@@@mail=phil.scott@syxxxxxco.tld@@@
dn cn=Alan Smith@@@mail=asmith@alxxon.tld@@@
to this format:
BEGIN:VCARD
FN:
EMAIL:joykyc@bexxxet.tld
END:VCARD

BEGIN:VCARD
FN:'Karen & Phil Scott'
EMAIL:phil.scott@syxxxxxco.tld
END:VCARD

BEGIN:VCARD
FN:Alan Smith
EMAIL:asmith@alxxon.tld
END:VCARD
It's a crested auklet

User avatar
Arf
Official Test Penquin
Posts: 9103
Joined: Tue Apr 09, 2002 12:00 am
Location: IDAHO, USA
Contact:

Re: Convert webmail address book to VCard

Post by Arf » Wed Mar 04, 2015 6:51 pm

Very cool. Thank you.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest