very simple, very stupid proof of concept
[p5sagit/Email-Archive.git] / test_run
1 #!/usr/bin/perl
2 use strict;
3 use warnings;
4 use Email::Simple;
5 use Email::Simple::Creator;
6
7 use lib 'lib';
8 use Email::Archive;
9
10 my $email = Email::Simple->create(
11     header => [
12       From    => 'casey@geeknest.com',
13       To      => 'drain@example.com',
14       Subject => 'Message in a bottle',
15       'Message-ID' => 'helloworld',
16     ],
17     body => 'hello there!'
18 );
19
20 my $e = Email::Archive->new({dsn => 'dbi:SQLite:dbname=test.db'});
21 print "sending @{[$email->as_string]}\n";
22 $e->store($email);
23
24 my $found = $e->retrieve('helloworld');
25 print $found->as_string;