Code Search for Developers
 
 
  

imap.pl from AlphaMail at Krugle


Show imap.pl syntax highlighted

#!/usr/bin/perl

use lib '/home/tkay/src/duckmail/lib';
use warnings;
use strict;
use Data::Dumper;
use Net::IMAP;
use Carp;

sub show_args
{
   print "show_args called with: " . Dumper(\@_);
}

sub fetch
{
   my $this = shift;
   my $arg = shift;
   my $envelope;
   my $from;

   if(defined($arg->{Items}{envelope})) {
      $envelope = $arg->{Items}{envelope};
      $from = $envelope->from->[0];
      print "Message " . $envelope->message_id . " From " . $from->as_string . " about " . $envelope->subject . "\n";
   } else {
      show_args($this, $arg, @_);
   }
}

print "Password: ";
`stty -echo`;
my $password = <STDIN>;
chomp $password;
`stty echo`;
print "\n";
my $c;

$c = new Net::IMAP('tick.uoregon.edu');
$c->set_untagged_callback("fetch", \&show_args);
#$c->set_untagged_callback("exists", \&show_args);
#$c->set_untagged_callback("recent", \&show_args);
#$c->set_untagged_callback("flags", \&show_args);
#$c->set_untagged_callback("status", \&show_args);
#$c->set_untagged_callback("ok", \&show_args);
#$c->set_untagged_callback("lsub", \&show_args);
$c->login('dummy1', $password) or croak "Could not log in";  
$c->select('inbox') or croak "Select failed";

$c->fetch('1', 'uid', 'envelope', 'body.peek[text]<0.80>', 'flags');

$c->logout;




See more files for this project here

AlphaMail

AlphaMail is an accelerated web mail interface with a C++ middleware layer that is more effective than an IMAP proxy which is a highly scalable (10k+ users). The interface includes modern features, Section 508 compliance, and universal browser support.

Project homepage: http://sourceforge.net/projects/alphamail
Programming language(s): C++,Java,JavaScript,Perl
License: other

  html_purify.pl
  imap.pl
  imap_cache_test.pl
  ispell.pl
  middleware_test.pl
  mime.pl
  subexp.pl
  test.html