Changeset 1447 in ProjectBuilder


Ignore:
Timestamp:
Apr 4, 2012, 5:14:48 PM (12 years ago)
Author:
ebaudrez
Message:

use either formail' or procmail'

Use either of those programs to process your mailboxes, whichever is
available, in that order of preference. Also, abort the program as early
as possible if neither program can be found.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • projects/md2mb/devel/md2mb/bin/md2mb.pl

    r1446 r1447  
    1515use Getopt::Long;
    1616use Pod::Usage;
     17use List::Util qw(first);
    1718
    1819# settings
    19 my $cmd="formail";
     20my $cmd = first {
     21        system("$_ </dev/null >/dev/null 2>/dev/null") == 0
     22    } qw(formail procmail);
     23$cmd or die <<EOF;
     24cannot find a usable program to manipulate your mailboxes in your \$PATH!
     25Try installing `formail' or `procmail'
     26Aborting
     27EOF
    2028# CHANGE AS YOU WISH
    2129my $oldroot = "/users/segolene/.Mail";
     
    5664    mkpath("$newroot",0, 0755) if ((not -d "$newroot") && (not $nrisfile));
    5765}
    58 system("$cmd </dev/null >/dev/null 2>/dev/null") == 0 or die "cannot find formail on your \$PATH!\nTry installing procmail\nAborting";
    5966
    6067# the main work is done here
     
    181188
    182189B<md2mb.pl> will import a B<kmail> maildir environment, and transform it into a
    183 B<thunderbird> one.
     190B<thunderbird> one. It relies on either B<formail> or B<procmail> being
     191available in your search path, and will preferentially use B<formail>.
    184192
    185193=head1 AUTHOR
Note: See TracChangeset for help on using the changeset viewer.