#!/usr/bin/perl
# Script name : tb2sylpheed
-# Script version: 1.0.1
+# Script version: 1.0.2
# Script based on : script kmail2sylpheed.pl
# Script purpose : convert The Bat! addressbook into Sylpheed addressbook
# Author : Aleksandar Urosevic aka Urke MMI <urke@gmx.net>
#
# Change Log:
#
+# 18-12-2003 v 1.0.2
+# - bugfix: added missing attribute-list start
+#
# 01-01-2003 v 1.0.1
# - bugfix: no more empty Business Homepage entry
# - bugfix: no more \0D\0A´s in Notes entry
chdir;
# check is Sylpheed instrtalled
-opendir(SYLPHEED, ".sylpheed") || die("Can't open Sylpheed directory! Conversion abroted\n");
+opendir(SYLPHEED, ".sylpheed-claws") || die("Can't open Sylpheed-Claws directory! Conversion abroted\n");
push(@cached, (readdir(SYLPHEED)));
closedir(SYLPHEED);
}
if ($check > 0) {
+ $sylph_addr .= " <attribute-list>\n";
if ($tbdata[1] ne "" || $tbdata[2] ne "") {
$time++;
if($tbdata[29] ne "" && $tbdata[1] ne "") { $full_name = "$tbdata[29] $tbdata[1]"; } else { $full_name = "$tbdata[1]"; }
}
$sylph_addr .= " </attribute-list>\n";
}
+# if ( $check > 0 ) {
+# $sylph_addr .= "</attribute-list>\n";
+# }
+
$sylph_addr .= " </person>\n";
$time++;
}
$sylph_addr .= "</address-book>\n";
# print new addressbook to file
-open (NEWADDR, ">.sylpheed/$new_addrbk");
+open (NEWADDR, ">.sylpheed-claws/$new_addrbk");
print NEWADDR $sylph_addr;
close NEWADDR;
# add new addressbook to index
-open (ADDRIN, "<.sylpheed/addrbook--index.xml") || die("Can't open addrbook--index.xml");
+open (ADDRIN, "<.sylpheed-claws/addrbook--index.xml") || die("Can't open addrbook--index.xml");
@addrindex_file = <ADDRIN>;
close ADDRIN;
}
}
-open (NEWADDRIN, ">.sylpheed/addrbook--index.xml");
+open (NEWADDRIN, ">.sylpheed-claws/addrbook--index.xml");
print NEWADDRIN "$rewrite_addrin";
close NEWADDRIN;
print "You have sucessfully converted your The Bat! addressbook\n";