defined(my $user = $u->user) or die "no user in $dest\n";;
x(qw/git config imap.user/, $user);
- my $p = $u->password;
- warn_imap_pass($ENV{GIT_CONFIG}) if (defined $p);
my $path = $u->path;
defined $path or $path = "INBOX";
$path =~ s!\A/!!; # no leading slash
x(qw/git config imap.folder/, $path);
+ warn_imap_pass($u->password, $ENV{GIT_CONFIG});
+
# this only needs to be set for Extractor to follow
local $ENV{GIT_CONFIG} = $state;
x(qw/git config/, "target.$target.imap", "true");
}
sub warn_imap_pass {
- my ($file) = @_;
- print STDERR <<EOF
+ my ($pass, $file) = @_;
+
+ if (defined $pass && length $pass) {
+ print STDERR <<EOF
ignoring IMAP password given on command-line
-ensure $file is not world-readable before editing
+EOF
+ }
+ print STDERR <<EOF
+ensure $file is not world-readable if editing
$file to set imap.pass
EOF
}