Email::LocalDelivery::Store - deliver mail via Email::Store
use Email::LocalDelivery; use Email::FolderType::Register qw[register_type]; register_type Store => sub { $_[0] =~ m/^DBI/i }; ... Email::LocalDelivery->deliver($mail, $dsn) or die "couldn't deliver to $dsn"; ...where $dsn is a full DBI DSN, including user= and password=, e.g. 'DBI:mysql:database=DATABASE;host=HOSTNAME;port=PORT;user=USER;password=PASSWORD'
This module is an Email::LocalDelivery wrapper for Email::Store, which is a "framework for database-backed email storage."
It allows you to easily swap in database email storage instead of Mbox or Maildir.
Just register the "Store" FolderType, like this:
and then call Email::LocalDelivery->deliver( $mail, $dsn )
This module was created to allow Siesta to archive mail in MySQL.
$rfc822 is an RFC822 formatted email message, and @dsns is a list of DBI DSN strings.
$rfc822
@dsns
Since Email::Store is instantiated with the DSN, and I really don't know what I'm doing, I had to eval 'use Email::Store $dsn' inside the deliver() method. I suspect that this will blow up if you try to pass more than one DSN, so I made it exit after the first one.
Email::Store (obviously) requires some form of database backend. Since you will have already figured all that out, this module doesn't test your database connection itself.
Bowen Dwelle <bowen@dwelle.org> http://www.dwelle.org/
Copyright (C) 2004 Bowen Dwelle. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
siesta, Email::LocalDelivery, Email::FolderType, Email::Store
2 POD Errors
The following errors were encountered while parsing the POD:
=over should be: '=over' or '=over positive_number'
You forgot a '=back' before '=head1'
To install Email::LocalDelivery::Store, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Email::LocalDelivery::Store
CPAN shell
perl -MCPAN -e shell install Email::LocalDelivery::Store
For more information on module installation, please visit the detailed CPAN module installation guide.