Email::Store::Mail - An email in the database
Email::Store::Mail->store($message) my $mail = Email::Store::Mail->retrieve($msgid); my Email::Simple $simple = $mail->simple; print $mail->message; # Plus many additional accessors added by plugins
While a fundamental concept in
message_id and a
message. A utility method
simple will produce a (cached)
Email::Simple object representing the mail.
When a mail is indexed with
store, all the plugins are called. Plugins register a method called
on_store to get their chance to play with an incoming mail, and
on_store_order to determine where in the process they wish to be called in relation to other modules.
on_store method gets passed the mail object and can examine and modify it while also doing what it needs to populate its own table(s).
When a message is stored but already exists in the database,
on_seen_duplicate is called in the plugins rather than
on_store. This allows, for instance, the List plugin to detect passage through addiional lists.