[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kmail-devel
Subject:    Re: [PATCH] KDE 2 -> KDE 3: upgrade SMTP/sendmail configuration
From:       Ingo =?iso-8859-1?q?Kl=F6cker?= <ingo.kloecker () epost ! de>
Date:       2002-02-18 21:26:48
[Download RAW message or body]

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Monday 18 February 2002 08:51, Michael Häckel wrote:
> On Sunday 17 February 2002 22:32:22, Ingo Klöcker wrote:
> > I didn't knew that there is a 'transports' counter. It shouldn't be
> > difficult to add that. At least I hope so. The worst case would be
> > to parse the whole config file. But as something like this was
> > already write for klipper it shouldn't be too hard to implement.
>
> You could possibly add a transports key to the "Transport 1" section
> you write anyway and then move this later with the normal
> kconf_update functions to "General".

Much to complicated. ;-)
I just had to add the following two lines to the perl script:
  print "\n[General]\n";
  print "transports=1\n";

kconf_update is really great.

Regards,
Ingo
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE8cXGZGnR+RTDgudgRAne5AKCJcrdAVKSwkjgC/V40t7aetzQ0BgCgwyj0
cfhr3q3101s0MjTjMkmCR8Q=
=yIrg
-----END PGP SIGNATURE-----

["upgrade-transport.pl" (text/x-perl)]

#!/usr/bin/perl
my (%data);

#read in all the data and split it up into hashes.
while (<>) {
  $data{$1} = $2 if /^([^=]*)=(.*)$/;
}

# Delete obsolete entries from the [sending mail] section
print "# DELETE Mailer\n";
print "# DELETE Method\n";
print "# DELETE Precommand\n";
print "# DELETE Smtp Host\n";
print "# DELETE Smtp Password\n";
print "# DELETE Smtp Port\n";
print "# DELETE Smtp Username\n";

# Write entries to the [Transport 1] section
print "precommand=$data{'Precommand'}\n";
print "port=$data{'Smtp Port'}\n";
if ($data{'Method'} eq "smtp") {
  print "type=smtp\n";
  print "host=$data{'Smtp Host'}\n";
  print "name=$data{'Smtp Host'}\n";
}
else {
  print "type=sendmail\n";
  print "host=$data{'Mailer'}\n";
  print "name=Sendmail\n";
}
print "\n[General]\n";
print "transports=1\n";

_______________________________________________
kmail Developers mailing list
kmail@mail.kde.org
http://mail.kde.org/mailman/listinfo/kmail

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic