Mail::Queue::DB

Mail::Queue::DB allows to store outgoing email locally in a Berkely DB.
Download

Mail::Queue::DB Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • S. Zachariah Sprackett
  • Publisher web site:
  • http://search.cpan.org/~zacs/Mail-Queue-DB-0.03/lib/Mail/Queue/DB.pm

Mail::Queue::DB Tags


Mail::Queue::DB Description

Mail::Queue::DB allows to store outgoing email locally in a Berkely DB. Mail::Queue::DB allows to store outgoing email locally in a Berkely DB.SYNOPSIS use Mail::Queue::DB; my $d = new Mail::Queue:DB( db_file => '.database'); print $d->count_queue() . " messages in the queue.n"; my $msg_id = $d->queue_mail($args, $msg); $z->dequeue_mail($msg_id); print $d->count_queue() . " messages in the queue.n";Mail::Queue::DB allows one to create a local outgoing email store in Berkely DB format. This mail can then be flushed over SSH or some other connection to an appropriate mailhost. This module and the associated tools work well on systems like laptops that need to be able to send mail while offline. It was designed to be complementary to OfflineIMAP.METHODSnew(db_file => $file)Creates a new Mail::Queue::DB object. The argument db_file must be defined.queue_mail($args, $msg)Adds a new message to the queue. Args must contain the arguments required to pass to sendmail to actually send the email. Typically, these arguments will be something like: -oem -oi -- user@example.comMsg contains the actual email message to be transmitted.On success, the message id of the newly queued email will be returned. On failure, queue_mail() returns undefqueue_mail($id, $have_lock)Deletes a message from the queue. Id must contain a valid message id. dequeue_mail() will attempt to attain a write lock on the database unless the boolean value have_lock is set.On success, queue_mail() returns 0. On failure, it returns a negative value.get_mail($id)Fetches the message identified by Id from the queue. On success, it returns an array of Args, Msg. On failure it returns undef.iterate_queue($callback, $locking)For each message in the queue, run the passed callback function. Lock state specifies the lock to hold for the entire iteration run. It can be one of either read or write. If not specified, a read lock is assumed.The passed in callback will receive arguments in the form callback( $id, $args, $msg )count_queue( )Returns an integer representing the number of emails currently in the queue. Requirements: · Perl


Mail::Queue::DB Related Software