Linux.com

Feature

Automatically add contacts to KAddressBook with KBBDB

By Mayank Sharma on October 26, 2006 (8:00:00 AM)

Share    Print    Comments   

Managing your address book and appending new addresses can get tiresome. If your email client is KMail, KBBDB can help with part of the job. This Perl-based filter sits idle waiting for messages to show up, then extracts any new sender's email address into KAddressBook.

The utility is inspired by the Insidious Big Brother Database (BBDB), which is a contact management utility for Emacs. If you use [X]Emacs as an email client, BBDB can watch incoming messages, and whenever a new email address is spotted, it automatically adds it to the contact list, maintained in its own database.

Similarly, whenever KBBDB is called upon, it extracts addresses from the message, creates a little vCard file, and invokes KAddressBook's DCOP interface to add the vCard entry to the KDE address book. KMail can then use these contacts for address completion while sending email.

To equip your KMail client with KBBDB, using a text editor, copy-paste the script into a plain file named kbbdb, place it under your home directory, and make it executable:

chmod +x ~/kbbdb

The script requires the Mail::Header and Mail::Address Perl modules. Under Debian, these are included in the libmailtools-perl package and can be obtained through apt-get:

apt-get install libmailtools-perl

Other distros with Perl installed can get them through Perl's CPAN repository:

perl -MCPAN -e 'install Mail::Header Mail::Address'

The script also requires KDE's KAddressBook be installed to append entries to. To check if everything's hunky-dory, run the script from the command line:

./kbbdb

If the script runs silently without any errors, you're ready to integrate it with KMail. The steps to create an email filter under KMail are outlined in the KBBDB help file:

perldoc kbbdb

Once set up, KBBDB can also be used to extract contact addresses from existing messages.

Share    Print    Comments   

Comments

on Automatically add contacts to KAddressBook with KBBDB

Note: Comments are owned by the poster. We are not responsible for their content.

Why I don't Auto add to address books

Posted by: Anonymous Coward on October 26, 2006 10:24 PM
I happen to use a combination of white & grey lists along with spam filtering and since my white list are allowed to completely bypass the spam filter so I can't afford the damage an automatic add has the potential to create.

#

Re:Why I don't Auto add to address books

Posted by: Anonymous Coward on October 30, 2006 02:08 AM
Before reacting and typing in some objection, why not see if the option can be turned off? Which it can, in kaddress book, automatic address parsing.

I didn't know this before checking, it took me about 10 seconds to find that answer just by looking, so it's not some big secret.

#

Add it to kde-apps.org

Posted by: Anonymous Coward on October 26, 2006 08:45 PM
If you haven't already, I suggest you consider adding an entry for this on kde-apps.org.

#

Didn't work on Ubuntu Dapper/Edgy

Posted by: Anonymous Coward on October 30, 2006 05:40 AM
Looks interesting but doesn't work on my Ubuntu Dapper/Edgy.No errors, no action.

#

Re:Didn't work on Ubuntu Dapper/Edgy

Posted by: Anonymous Coward on January 12, 2007 06:51 AM
Hello there, i'm also using ubuntu and this script didn't worked for me either, so i've started to debugging it and with the #kde-devel irc channel help i've managed to find the issue.

using this patch it would work.

--- kbbdb 2006-09-30 23:25:31.000000000 -0500
+++ kbbdb-tst 2007-01-11 17:45:55.000000000 -0500
@@ -182,12 +182,16 @@ END:VCARD

  ENDPRINT

      }

  }
+
+
+my ($argumento) = "`cat $tempfile`" ;
+

  #

  # Send the file to KAddressBook

  if ( @addresses )

  {

      close ( TEMP ) ;
- system ( "dcop kaddressbook KAddressBookIface importVCard file://$tempfile" ) ;
+ system ( "dcop kaddressbook AddressBookServiceIface importVCard\\(QString\\) \"$argumento\"" ) ;

      unlink ( $tempfile ) ;

  }

  exit ( 0 ) ;

#

Re:Didn't work on Ubuntu Dapper/Edgy

Posted by: Anonymous Coward on January 12, 2007 07:06 AM
A side note about my previous patch, be careful applying the KBBDB script because if you put it before your antispam filters it would add the spammers addresses to your addressbook...<nobr> <wbr></nobr>:(

Also you can download it form this link

<a href="http://www.seaq.com.co/linux/kbbdb/" title="seaq.com.co">http://www.seaq.com.co/linux/kbbdb/</a seaq.com.co>

Regards

Andres Mujica
RHCE #804005093216652
<a href="http://www.seaq.com.co/" title="seaq.com.co">http://www.seaq.com.co/</a seaq.com.co>

#

Automatically add contacts to KAddressBook with KBBDB

Posted by: Anonymous [ip: 85.180.45.25] on February 05, 2008 08:33 PM
how can i patch the file? I have no idea how to do it. or is it possible to upload a patched version? thx. john

#

This story has been archived. Comments can no longer be posted.



 
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya