GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
Email::Delete(3) User Contributed Perl Documentation Email::Delete(3)

Email::Delete - Delete Messages from Folders

version 2.002

  use Email::Delete qw[delete_message];
  
  my $message_id = shift @ARGV;
  
  delete_message from     => $ENV{MAIL},
                 matching => sub {
                   my $message = shift;
                   $message->header('Message-ID') =~ $message_id;
                 };

This software will delete messages from a given folder if the test returns true.

  delete_message from     => 'folder_name',
                 with     => 'My::Delete::Package',
                 matching => sub { return_true_for_delete() };

"from" is a required parameter, a string containing the folder name to delete from. By default "Email::FolderType" is used to determine what package to use when deleting a message. To override the default, specify the "with" parameter. Your package's "delete_message" function will be called with the same arguments that "delete_message" from Email::Delete is called with.

"matching" is a required argument. Its value is a code reference. If the anonymouse subroutine returns a true value, the current message is deleted. Each message is passed to the "matching" test in turn. The first and only argument to "matching" is an "Email::Simple" object representing the message.

If you should ever want to stop processing a mailbox, just call "die" from your code reference. A proper deleting package will not delete mail until all the messages have been scanned. So if you throw an exception, your mail will be preserved and scanning will be aborted.

Email::Simple, Email::Folder, Email::LocalDelivery, perl.

Casey West, <casey@geeknest.com>.

  Copyright (c) 2004 Casey West.  All rights reserved.
  This module is free software; you can redistribute it and/or modify it
  under the same terms as Perl itself.
2013-07-30 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.