[clug] Recovering stored email account passwords in Evolution
(2.0.4)
Stephen Jenkin
sjenkin at canb.auug.org.au
Thu Feb 16 04:18:31 GMT 2006
Ever wondered how you get back 'remembered' passwords in Ximian
Evolution?? [Forgot one, didn't I :-)]
Here's what I found, documented for the archive, Just In Case others run
into the same failure of memory ... Tried Google & RTFM, was forced to
"Use the Source, Luke" [well, it was funny once]
These are the interesting files I found in the source tree (92Mb, 1100+
source files)
evolution-2.0.4/e-util/e-account.c
evolution-2.0.4/e-util/e-passwords.h
evolution-2.0.4/e-util/e-passwords.c
And the hints in the source code.
e-passwords.c:259 ->
static void
ep_remember_password(EPassMsg *msg)
and e-passwords.c:272->
base64_encode_close (value, len, FALSE, pass64, &state, &save);
gnome_config_private_set_string (path, pass64);
=> So the passwords are saved as Base64 at the end of the line.
Perl has a module that nicely decodes & encodes Base64.
Evolution uses 'gconf' (eg gconf-editor) to save all settings
[in $HOME/.gconf/apps/evolution/... ]
BUT it saves passwords in a *private* place:
$HOME/.gnome2_private/Evolution [note capitalisation]
=> found this by file search. Not sure where this is configured.
Here's the contents of my file for some publicly known email accounts:
pop:__sjenkin at mailhost.tip.net.au_=XXXXXXXXXX==
pop:__sjenkin at supreme.tip.net.au_=XXXXXXXXXX==
imap:__s620853 at mail.canberra.edu.au_=XXXXXXXXXX==
smtp:__sjenkin;auth_PLAIN at smtps.tip.net.au_=XXXXXXXXXX==
imap:__sjenkin%40fastmail.fm at mail.messagingengine.com_=xxxxxxxxxx==
Note: the Field Separator is '_='
the trailing '==' are to pad the input to multiple of 4 bytes.
A leading '=' is invalid Base64 & the perl module will bark at you.
My two trivial perl scripts are below (yes, they are naive)
As an exercise for The Reader, you can make a perl script to read the file
natively and printout the contents...
To recover my passwords, I picked out the Base64 strings by hand and ran:
b64-dec xxxxxxxxxx== XXXXXXXXXX==
Hope this is useful :-)
cheers
steve
----------------------------------------------------------
Example of scripts:
[steve at p4 ~]$ b64-enc 123456 abcdef
123456 MTIzNDU2
abcdef YWJjZGVm
[steve at p4 ~]$ b64-dec MTIzNDU2 YWJjZGVm
MTIzNDU2 123456
YWJjZGVm abcdef
----------------------------------------------------------
script: b64-dec
----------------------------------------------------------
#!/usr/bin/perl -w
#/home/steve/bin/b64-dec
#steve Jenkin Thu Feb 16 14:35:26 EST 2006
use strict;
use Carp;
use MIME::Base64; # qw(encode_base64);
foreach my $s (@ARGV)
{
printf("%s\t", $s);
printf("%s\n", decode_base64($s));
}
----------------------------------------------------------
script: b64-enc
----------------------------------------------------------
#!/usr/bin/perl -w
#/home/steve/bin/b64-dec
#steve Jenkin Thu Feb 16 14:35:26 EST 2006
use strict;
use Carp;
use MIME::Base64; # qw(encode_base64);
foreach my $s (@ARGV)
{
printf("%s\t", $s);
printf("%s\n", encode_base64($s, ''));
}
----------------------------------------------------------
Steve Jenkin, Unix Sys Admin
0412 786 915 (+61 412 786 915)
PO Box 48, Kippax ACT 2615, AUSTRALIA
sjenkin at canb.auug.org.au http://www.tip.net.au/~sjenkin
More information about the linux
mailing list