MailFolder

 view release on metacpan or  search on metacpan

examples/xmailfolder.pl  view on Meta::CPAN

#   tree representation of folder list
#   filters
#   x-face
#   pgp
#   uuencoded chunks
#   do MIME
#   improve folder summary output
#   include more info in folderlist summary
#   add:
#	write to a file
#       bounce message (make sure auto 'From:' generation does the right thing)
#       refile message
#       copy message
#       sort folder
#       message label stuff
#       select messages
#       search messages
#       create new folder
#       delete folder
#       rename folder
#   Options
#      automove on delete		boolean
#      folder locking style
#      signature list (with editor)
#    x Debug				boolean
#      DecodePrintedQuotableHeaders	boolean
#    x DefaultComposeTemplate
#    x DefaultSignature
#    x ShowAllHeaders			boolean
#      lots more...
#   composes should be in a draft folder
#   add toolbar
#   add pop3-downloader
#   make folderlist summary into it's own object class
#   add online help
#   optionally process delivery-status-notification field
#   virtual folders
#   maybe .xmailfolderc needs to be processed in it's own name space
#      with various methods to access values
#   variablize the embedded strings for internationalization
#   ispell interface
# PROBLEMS
#   figure out what caused this:
#      Tk::Error: (in cleanup) no lock on  at $MAILFOLDER/Mbox.pm line 689
#       Carp::croak at $PERLLIB/Carp.pm line 127
#       File::BasicFlock::unlock at $SITEPERL/File/BasicFlock.pm line 80
#       Mail::Folder::Mbox::unlock_folder at $MAILFOLDER/Mbox.pm line 689
#       Mail::Folder::Mbox::DESTROY at $MAILFOLDER/Mbox.pm line 650
#       (command bound to event) at $SITEPERL/auto/Tk/Error.al line 13.
#   need to investigate what happens to folder opening when the window is
#      slammed shut at inappropriate times
#   activation line is getting forgotten in folderlist summary after an Open
#   figure out how to have folderlist updated without having Folder->close
#      call main::CloseFolder
#   pack needs to adjust current_message accordingly
#   figure why a abnormal exit doesn't cleanup the open mailbox
#   key accelerators are conflicting with each other (Alt-f,c vs. c)
#   actually detect error returns from MailFolder calls
#   do more appropriate error handling in CoreCompose and friends
# SNIGGLES
#   add busy-cursor in appropriate places
#   figure how to get a Shift-(Next|Prior) to move the msg window in the
#      folder window
#   figure out how set width of scrollbars - normal way isn't working

require 5.00397;

my $VERSION = '0.01';
use vars qw($top
	    %fieldcolors
	    @ignore_headers
	    %signatures
	    %composetemplates
	    @folders
	    $username);

use strict;
use Tk qw(exit);
use Tk::widgets qw(Font Menubar Dialog DialogBox NoteBook
		   ROText WaitBox BrowseEntry);
use Mail::Folder::Mbox;
use Mail::Folder::Emaul;
use Mail::Folder::Maildir;
use Net::Domain;
use Mail::Internet;
use MIME::Head;
use IO::File;
use IO::Pipe;

$username = get_username();
my $homedir = $ENV{HOME};
my $sendmail = '/usr/lib/sendmail -t -oi -em';
my $indentstr = '>';

$top = new MainWindow;
$top->title('X-MailFolder');
$top->minsize(1, 1);

my $camel = $top->Photo(-file => Tk->findINC("Xcamel.gif"));
#my $fixedfont = $top->Font(family => 'courier', slant => 'r',
#			   point => 120, weight => 'medium');
my $fixedfont = $top->Font(family => 'courier', slant => 'r',
			   weight => 'medium');

my $foldersinfo;
my $foldersidx;
my $counter = 0;

my %Options = (
	       ShowAllHeaders => 0,
	       DefaultSignature => 'short',
	       DefaultComposeTemplate => 'NONE',
	       Debug => 0,
	      );
%fieldcolors = ();

@ignore_headers = ();

@folders = ();
foreach my $dir (qw(/var/spool/mail /usr/spool/mail /usr/mail)) {
  if (-e "$dir/$username") {



( run in 1.543 second using v1.01-cache-2.11-cpan-39bf76dae61 )