Mail-IMAPFolderSearch

 view release on metacpan or  search on metacpan

IMAPFolderSearch.pm  view on Meta::CPAN

package Mail::IMAPFolderSearch;
				
use strict;
use IO::Socket::SSL;
use IO::Socket;

use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);

require Exporter;

@ISA = qw(Exporter AutoLoader);
# Items to export into callers namespace by default. Note: do not export
# names by default without a very good reason. Use EXPORT_OK instead.
# Do not simply export all your public functions/methods/constants.

IMAPFolderSearch.pm  view on Meta::CPAN

                                 What => 'NOT TO' },
                   Keyword6 => { Word => 'test' }
                  };

     $imap->searchFolders(Keywords => $keywords);

     $imap->logout();

=head1 REQUIRES

IO::Socket, IO::Socket::SSL

=head1 DESCRIPTION

Many e-mail clients such as F<PINE> allow the user to search
for a string within a single folder.  Mail::IMAPFolderSearch allows
for scripting of multiple string searches, spanning multiple
mail folders.  Results are placed in a new folder allowing
the user to use their existing mail client to view  
matching messages.  The results folder is named IMAPSearch by 
default, but it is possible to specify a different name.  

IMAPFolderSearch.pm  view on Meta::CPAN


sub login {
	my $imap = shift;
	my $args = { @_ };
	$imap->{User} = $args->{User} || die "User not specified";
	$imap->{Password} = $args->{Password} || die "Password is required";
	my $socket; 
	if ($imap->{SSL} == 0) {
		$socket = IO::Socket::INET->new("$imap->{Server}:$imap->{Port}") || die "Can't connect $!";
	} else {
		$socket = IO::Socket::SSL->new( SSL_verify_mode => 0x00,
							SSL_use_cert => 0,
							PeerAddr => $imap->{Server},
							PeerPort => $imap->{Port} 
							) || die "Can't connect $!";
	}
	$imap->{Socket} = $socket;
	my $ulen = length($imap->{User});
	my $plen = length($imap->{Password});
	$socket->print("$imap->{Count} LOGIN \{$ulen\}\r\n");	
	$socket->print("$imap->{User} \{$plen\}\r\n");	

IMAPFolderSearch.pm  view on Meta::CPAN

=item *

Regular expressions do not work, as per RFC 2060.

=head1 AUTHOR

Brian Hodges <bhodgescpan ^at^ pelemele ^dot^ com>

=head1 SEE ALSO

perl(1), L<IO::Socket>, L<IO::Socket::SSL>

INSTALL  view on Meta::CPAN

Installation of Mail::IMAPFolderSearch

Before getting started, make sure you have any required
modules installed.

Dependencies:
	o IO::Socket
	o IO::Socket::SSL

	For 'make test' (optional):
	o Term::ReadKey
	o MIME::Base64



1) perl Makefile.PL
	
	o Answer a few questions for make test.  This

README  view on Meta::CPAN

Mail::IMAPFolderSearch - Search multiple mail folders via a IMAP4rev1 server

REQUIRES
    IO::Socket, IO::Socket::SSL

DESCRIPTION
    Many e-mail clients such as PINE allow the user to search for a string
    within a single folder. Mail::IMAPFolderSearch allows for scripting of
    multiple string searches, spanning multiple mail folders. Results are
    placed in a new folder allowing the user to use their existing mail
    client to view matching messages. The results folder is named IMAPSearch
    by default, but it is possible to specify a different name.

AUTHOR
        Brian Hodges <perl@pelemele.com>

SEE ALSO
        perl(1), IO::Socket, IO::Socket::SSL

INSTALLATION of Mail::IMAPFolderSearch

Before getting started, make sure you have any required
modules installed.

Dependencies:
	o IO::Socket
	o IO::Socket::SSL

	For 'make test' (optional):
	o Term::ReadKey
	o MIME::Base64



1) perl Makefile.PL
	
	o Answer a few questions for make test.  This

t/imaptest.t  view on Meta::CPAN

	my $connection = { SSL => $ssl,
			   Port => $port,
			   Server => $server,
			   User => $user,
			   Password => $password,
			 };
	return $connection;
}

sub checkModules {
	use IO::Socket::SSL;
	use IO::Socket;
	return 1;
}


sub testIMAP {
	my $connect  = shift;
	print "ok 3\n" if (
			my $imap = Mail::IMAPFolderSearch->new(SSL => $connect->{SSL},
							  Port => $connect->{Port},



( run in 0.517 second using v1.01-cache-2.11-cpan-4d50c553e7e )