flail

 view release on metacpan or  search on metacpan

ChangeLog  view on Meta::CPAN

2000-12-18  attila  <attila@stalphonsos.com>

	* flail: Added missing waitpid() call to avoid creating umpteen
	zombies  Some other silly fixes.

2000-12-02  attila  <attila@stalphonsos.com>

	* flail: Added support for non-selfsigned keys because a friend
	insists on using an old PGP 2.6 key that isn't self-signed.  I
	don't know why, but it actually lets me deal a little better with
	gpg anyway, when there are errors.  Made GPG interaction generally
	more fault-tolerant.

2000-11-06  attila  <attila@stalphonsos.com>

	* install.pl: Wrote an installer.  Seems to work under BSD and
	Linux, have not tried it on other Unix systems.  Packaged up
	the modules we need in perl-modules and readline-4.1

	* flail: Lots of bug fixes.  This is 0.1.22

2000-08-04  attila  <attila@stalphonsos.com>

	* flail: Bug fixes galore, extended gpg_op() to handle decryption
	as well as encryption and signing, added built-in decrypt command
	to invoke it properly.  This is 0.1.19 [0.1.18 was what I've been
	using since the middle of July].

2000-07-04  attila  <attila@stalphonsos.com>

	* flail (call_editor): Switched to Proc::SyncExec and fixed the
	problem with using gnuedit [TMPDIR was set incorrectly].  This is
	0.1.17.

2000-07-02  attila  <attila@stalphonsos.com>

	* flail (gpg_op): Made it so that our idea of which GPG home
	dir to use can be based on the entire email address, not just
	the user name; I need this because snl@stalphonsos.net has a
	different keypair from snl@halosoft.com.  Fixed send/draft so
	that a couple headers [Mail-From and Status] get deleted before
	you edit the message, because they make no sense in that context.
	This is 0.1.16.

2000-06-26  attila  <attila@stalphonsos.com>

	* flail (filter_addresses): Fixed stupid bug that was adding
	spurious, empty headers.

2000-06-25  attila  <attila@stalphonsos.com>

	* flail (gpg_op): Implemented gpg_op using
	PGP::GPG::MessageProcessor and SecretPipe's for storing your
	passphrase [which you can set in .flailrc which should be stored
	in an encrypted filesystem].  This means you don't have to type
	your passphrase all the time, and is also just cleaner [you can
	always use pgp2 the old way with : from the composer].  Also
	cleaned up address handling everywhere using headaddrs() so
	address lists with commas in them work the way you'd expect
	them to now.  First cut at a "drafts" folder functionality, which
	works, but sort of strangely at the moment.  This is 0.1.15.

ChangeLog  view on Meta::CPAN

	old DEC-style options, i.e.
		flail> send/as:alt@altdomain.com/verbose
	will call flail_send with $OPT bound to a hash that maps
	as => alt@altdomain.com and verbose => 1.  Added support
	to flail_send to let you send as some identity of yours.

2000-03-01  attila  <attila@stalphonsos.com>

	* flail: Greatly extended send_internal's command set.  Added
	built-in commands to attach a .sig, sign cryptographically and
	encrypt+sign [by default with gpg, but you can customize via
	.flailrc].  Added the ability to give multiple composer actions
	in one shot.  Added the ability to invoke an arbitrary piece of
	perl code on your message from the composer.  Added a real help
	message.  Also wrote the .sig code, cleaned up a couple of things.

2000-02-29  attila  <attila@stalphonsos.com>

	* flail (print_paged_line): Fixed the stupid bug in the pager.
	Man, was that dumb.

Makefile-PL.TNG  view on Meta::CPAN

sub MY::postamble {
    print STDERR "To install completely:\n";
    print STDERR "    \$ make\n    \$ sudo make install\n";
    print STDERR "\nDon't forget to read the README and the POD.\n";
    print STDERR "Examples will be installed somehwere like /usr/local/share/examples/flail\nThey are also in the eg/ subdirectory of this distribution.\n\nEat your veggies.\n\n";
    return <<__MyTaRgEt__;
OPENSSLCMD?=openssl
MD5CMD?=\$(OPENSSLCMD) dgst -md5
SHA1CMD?=\$(OPENSSLCMD) dgst -sha1
RIPEMD160CMD?=\$(OPENSSLCMD) dgst -ripemd160
GPGCMD?=gpg
GPGKEYID?=0x4FFCBB9C
RELEASEDIR?=\$\$HOME/release
RELEASETARBALL?=\$(NAME)-\$(VERSION).tar.gz
RELEASEFILES?=\$(RELEASETARBALL) \$(NAME)-\$(VERSION).tar.gz.md5 \$(NAME)-\$(VERSION).tar.gz.sha1 \$(NAME)-\$(VERSION).tar.gz.ripemd160 \$(NAME)-\$(VERSION).tar.gz.asc
RELEASETARGETS?=dist md5 sha1 ripemd160 asc
RM?=/bin/rm
SHAREDIR?=\$(PREFIX)/share
EXAMPLEDIR?=\$(SHAREDIR)/examples/\$(NAME)
EXAMPLES?=eg
MKDIR_P?=mkdir -p

Makefile.PL  view on Meta::CPAN

sub MY::postamble {
    print STDERR "To install completely:\n";
    print STDERR "    \$ make\n    \$ sudo make install\n";
    print STDERR "\nDon't forget to read the README and the POD.\n";
    print STDERR "Examples will be installed somehwere like /usr/local/share/examples/flail\nThey are also in the eg/ subdirectory of this distribution.\n\nEat your veggies.\n\n";
    return <<__MyTaRgEt__;
OPENSSLCMD?=openssl
MD5CMD?=\$(OPENSSLCMD) dgst -md5
SHA1CMD?=\$(OPENSSLCMD) dgst -sha1
RIPEMD160CMD?=\$(OPENSSLCMD) dgst -ripemd160
GPGCMD?=gpg
GPGKEYID?=0x4FFCBB9C
RELEASEDIR?=\$\$HOME/release
RELEASETARBALL?=\$(NAME)-\$(VERSION).tar.gz
RELEASEFILES?=\$(RELEASETARBALL) \$(NAME)-\$(VERSION).tar.gz.md5 \$(NAME)-\$(VERSION).tar.gz.sha1 \$(NAME)-\$(VERSION).tar.gz.ripemd160 \$(NAME)-\$(VERSION).tar.gz.asc
RELEASETARGETS?=dist md5 sha1 ripemd160 asc
RM?=/bin/rm
SHAREDIR?=\$(PREFIX)/share
EXAMPLEDIR?=\$(SHAREDIR)/examples/\$(NAME)
EXAMPLES?=eg
MKDIR_P?=mkdir -p

Web/index.html  view on Meta::CPAN

          </td>
        </tr>

        <!-- 0.2.4 -->
        <tr class="data">
          <td width="10%" valign="top"><p class="rel"><a href="bits/flail-0.2.4.tar.gz">0.2.4</a></p></td>
          <td>
            <p class="desc">
              Fixed bug in ls output for messages with goofy whitespace in
              headers (e.g. tons of spam), fixed some hard-coded constants (e.g. path
              to gpg), added SMTP AUTH fu, added the <tt>pipe</tt> command, added
              <tt>/debug</tt>, <tt>/verbose</tt> and <tt>/quiet</tt> options to many
              commands (including <tt>send_internal</tt>), fixed <tt>help brief</tt>
              command, made <tt>flail_defcmd1</tt> overwrite existing aliases by
              default so we can <tt>reconf</tt> sanely, updated the POD,
              wrote a working <tt>Makefile.PL</tt> for flail version 0.x and renamed
              the flail version 1.x makefile to something else for now, updated
              examples in <tt>eg/</tt>.
            </p>
          </td>
        </tr>

Web/index.html  view on Meta::CPAN

              Aterm!  I'm a dork!
            </p>
          </td>
        </tr>

        <!-- 0.1.27 -->
        <tr class="data">
          <td width="10%" valign=top><p class="rel"><a href="bits/flail-0.1.27.tar.gz">0.1.27</a></td>
          <td>
            <p class="desc">Fixed the reply From address bug.  Fixed the
              orphaned gpg child process bug.  Fixed some POP issues.
              Aborted attempt to add Maildir support because I need to rework
              a few things.  Damn.  Otherwise, reasonably solid.
            </p>
          </td>
        </tr>

        <!-- 0.1.22 -->
        <tr class="data">
          <td width="10%" valign=top><p class="rel"><a href="bits/flail-0.1.22-full.tar.gz">0.1.22</a></td>
          <td>

dot.flailrc  view on Meta::CPAN


flail_defcmd1("be",\&cmd_be,"switch identities, or list available");
{ local($Quiet) = (1); cmd_be("MyDefaultID"); }
flail_defcmd1("reconf",\&cmd_reconf,"reload configuration file(s)");
flail_defcmd1("ssz",\&cmd_ssz,"total up spam folders' sizes");
flail_defcmd1("split",\&cmd_split_folder,"base chunk: split up a folder");
flail_defcmd1("invert",\&cmd_invert_label,"label: invert label selection");

## aliases

flail_alias("verify","|gpg --verify");
flail_alias("mm","|metamail -p"); # subtly wrong... also: metamail SUCKS
flail_alias("mark_before","mark ,is_before(%m,\"%*\")");
flail_alias("mark_after","mark ,is_after(%m,\"%*\")");
flail_alias("mark_about","mark ,is_about(%m,\"%*\")");
flail_alias("mark_from","mark ,is_from(%m,\"%*\")");
flail_alias("mark_to","mark ,is_to(%m,\"%*\")");
flail_alias("mark_spam", "mark ,is_spam(%m)");
#flail_alias("toss_spam", "map all { toss_spam(); }");
flail_alias("incoming","cd INCOMING");
#flail_alias("spam", "map cur mv %m spam");

flail0.pl  view on Meta::CPAN

$RemoveFromServer = 1;
$SMTPPort = 25;
$TempCounter = 1;
$AskBeforeSending = 1;
$DontCacheConnections = 0;
$AllowCommandOverrides = 0;
$AutoSyncIncoming = 0;
$IMAPAutoExpunge = 0;
$PlainOutput = 0;
$PlainOutput = 1 if defined($ENV{'TERM'}) && ($ENV{'TERM'} =~ /^dumb|emacs$/);
#$GPGBinary = "/home/attila/gpg-1.2/bin/gpg";
$GPGBinary = "/usr/local/bin/gpg" if (-x "/usr/local/bin/gpg");
$GPGBinary ||= "/usr/bin/gpg" if (-x "/usr/bin/gpg");
$CryptoSignCmd = "$GPGBinary --clearsign";     # set in .flailrc
$CryptoCryptCmd = "$GPGBinary --armor -se";    # ditto
$AutoDotSig = undef;                    # set to automatically attach .sig
$SMTPTout = $DEF_SMTP_TOUT;
$SMTPDebug = 0;
$GPGHomeDir = $ENV{'HOME'} . "/.gnupg";
$DateHeaderFmt = "%a, %d %b %G %T %Z";
$DraftsFolder = "drafts";
$LeftJustifyList = 0;
$SpoolDir = '/var/mail' if -d '/var/mail';

flail0.pl  view on Meta::CPAN

        } elsif ($word && length($word)) {
            push(@$cmd, (!$wantref1 && ($word =~ /\s/)) ? qq|"$word"| : $word);
        }
    }
    if (@$cmd) {
        push(@$commands,$wantref1 ? $cmd : join(' ',@$cmd));
    }
    return $wantref0 ? $commands : @$commands;
}

# gpg_op - run gpg on a message
sub gpg_op {
  my($msg,$op,$recips) = @_;
  $op = 's' unless $op;
  dsay "gpg_op: $op\n";
  my $head = $msg->head();
  my $fa;
  if ($op =~ /d/i) {
    $fa = headaddr0($head, "To");
  } else {
    $fa = headaddr0($head, "From");
  }
  my($fauser,$fahost) = address_email($fa);
  my $faf = $fauser . '@' . $fahost;
  dsay "fauser=$fauser,fahost=$fahost";
  my $faemail = "$fauser\@$fahost";
  if (!defined($recips)) {
    $recips = headaddrs($head, "To");
  }
  dsay "gpg recips:";
  dsay join("  \n", @$recips);
  my $mp = new PGP::GPG::MessageProcessor;
  my $ghd = $GPGHomeDirs{$faf} || $GPGHomeDirs{$fauser} || $GPGHomeDir;
  $mp->{homedir} = $ghd if $ghd;
  my $p = get_password("GPG/$faf", "Passphrase for $faf");
  while (!$mp->passphrase_test($p)) {
    print "Bad passphrase.\n";
    forget_password("GPG/$faf");
    $p = get_password("GPG/$faf", "Passphrase for $faf");
  }

flail0.pl  view on Meta::CPAN

    return;
  }
  my $n = $_[0];
  if (!defined($n)) {
    my $msg = $FOLDER->get_message($FOLDER->current_message);
    if (!defined($msg)) {
      print "could not get current message\n";
    } else {
      if ($do_decrypt) {
        my $won;
        ($won,$msg) = gpg_op($msg, "d", undef);
        print "[GPG operation failed; displaying encrypted message]\n"
            unless $won;
      }
      page_msg($msg);
    }
  } else {
    my @tmp;
    eval { @tmp = parse_range("@_"); };
    @_ = @tmp unless $@;
    while ($n = shift(@_)) {

flail0.pl  view on Meta::CPAN

        next;
      }
      my $msg = $FOLDER->get_message($n);
      if (!defined($msg)) {
        print "$FOLDER_NAME: no message number $n\n";
        return;
      }
      if ($do_decrypt) {
        print "[Decrypting...]\n" if $Verbose;
        my $won;
        ($won,$msg) = gpg_op($msg, "d", undef);
        print "[GPG operation failed; displaying encrypted message]\n"
            unless $won;
      }
      page_msg($msg);
      $FOLDER->current_message($n);
    }
  }
}

sub flail_pipe {

flail0.pl  view on Meta::CPAN

        ($yorn =~ /^[yY]/) && ($done = 1,$yorn=undef);
        ($yorn =~ /^[nN]/) && ($done = -1,$yorn=undef);
        ($yorn =~ /^d/) &&(save_msg($edited,$DraftsFolder,"draft"),$done=-1,$yorn=undef);
        ($yorn =~ /^e/) && ($done = 2,$yorn=undef);
        ($yorn =~ /^[pP]/) && page_msg($edited);
        ($yorn =~ /^s/) && sign_msg($edited);
        ($yorn =~ /^[aA]/) && filter_addresses($edited,$AskAddressBook);
        ($yorn =~ /^S/ && !$HaveGPGMP) &&
          ($edited = pipe_msg($CryptoSignCmd, $edited, 1));
        ($yorn =~ /^S/ && $HaveGPGMP)&&
                     (($won,$edited)=gpg_op($edited, "s", undef));
        ($yorn =~ /^E/ && !$HaveGPGMP) &&
          ($edited = pipe_msg($CryptoCryptCmd, $edited, 1));
        ($yorn =~ /^E/ && $HaveGPGMP) &&
                     (($won,$edited)=gpg_op($edited,"se",undef));
        ($yorn =~ /^2/ && $HaveGPGMP) &&
                     (($won,$edited)=gpg_op($edited,"sei",undef));
        ($yorn =~ /^\|(.*)$/) && ($edited = pipe_msg($1, $edited),$yorn=undef);
        ($yorn =~ /^\:(.*)$/) && ($edited =pipe_msg($1,$edited,1),$yorn=undef);
        ($yorn =~ /^,(.*)$/) && (invoke_code_on_msg($edited, $1),$yorn=undef);
        $yorn = substr($yorn, 1);
        $yorn = undef if ($yorn eq "");
      }
    }
    if ($done < 0) {
      print "send aborted\n";
      return;

flail0.pl  view on Meta::CPAN

        ($yorn =~ /^[yY]/) && ($done = 1,$yorn=undef);
        ($yorn =~ /^[nN]/) && ($done = -1,$yorn=undef);
        ($yorn =~ /^d/) &&(save_msg($edited,$DraftsFolder,"draft"),$done=-1,$yorn=undef);
        ($yorn =~ /^e/) && ($done = 2,$yorn=undef);
        ($yorn =~ /^[pP]/) && page_msg($edited);
        ($yorn =~ /^s/) && sign_msg($edited);
        ($yorn =~ /^[aA]/) && filter_addresses($edited,$AskAddressBook);
        ($yorn =~ /^S/ && !$HaveGPGMP) &&
          ($edited = pipe_msg($CryptoSignCmd, $edited, 1));
        ($yorn =~ /^S/ && $HaveGPGMP)&&
                     (($won,$edited)=gpg_op($edited, "s", undef));
        ($yorn =~ /^E/ && !$HaveGPGMP) &&
          ($edited = pipe_msg($CryptoCryptCmd, $edited, 1));
        ($yorn =~ /^E/ && $HaveGPGMP) &&
                     (($won,$edited)=gpg_op($edited,"se",undef));
        ($yorn =~ /^2/ && $HaveGPGMP) &&
                     (($won,$edited)=gpg_op($edited,"sei",undef));
        ($yorn =~ /^\|(.*)$/) && ($edited = pipe_msg($1, $edited),$yorn=undef);
        ($yorn =~ /^\:(.*)$/) && ($edited =pipe_msg($1,$edited,1),$yorn=undef);
        ($yorn =~ /^,(.*)$/) && (invoke_code_on_msg($edited, $1),$yorn=undef);
        $yorn = substr($yorn, 1);
        $yorn = undef if ($yorn eq "");
      }
    }
    if ($done < 0) {
      print "send aborted\n";
      return;



( run in 1.913 second using v1.01-cache-2.11-cpan-df04353d9ac )