Make the boss happy.
[kdepim.git] / kmail / kconf_update / kmail-3.3-aegypten.pl
blobe891ea48923ed79accdbe563fe3e94fcd29f8efa
1 #!/usr/bin/perl -w
3 use strict;
5 # This script updates some configuration keys and adds a 'mailto:' to all
6 # mailing list posting addresses
8 # read the whole config file
9 my $currentGroup = "";
10 my %configFile;
11 while ( <> ) {
12 chomp; # eat the trailing '\n'
13 next if ( /^$/ ); # skip empty lines
14 next if ( /^\#/ ); # skip comments
15 if ( /^\[/ ) { # group begin
16 $currentGroup = $_;
17 next;
18 } elsif ( $currentGroup eq "" and /^pgpType/ ) {
19 my ($key,$value) = split /=/;
20 # 0 is auto -> delete key, i.e. use the default
21 # 1-4 map to the kpgp ones
22 # 5 is off -> off; since there's no such backend it won't set one
23 if ( $value != 0 ) {
24 my @newvalues = ("","Kpgp/gpg1","Kpgp/pgp v2","Kpgp/pgp v5","Kpgp/pgp v6","");
25 print "OpenPGP=$newvalues[$value]\n";