summaryrefslogtreecommitdiffstats
path: root/.local/bin/fetch_mail
diff options
context:
space:
mode:
authorjoe <rbo@gmx.us>2025-10-01 19:34:29 +0200
committerjoe <rbo@gmx.us>2025-10-01 19:34:29 +0200
commitafb17881310a22b646042a3bbaf3dbc07f4cdfcb (patch)
treeb18602ac9cc8c97322280c6de46ab0f67b4a7ff0 /.local/bin/fetch_mail
parentup (diff)
downloaddotfiles-bsd-afb17881310a22b646042a3bbaf3dbc07f4cdfcb.tar.gz
dotfiles-bsd-afb17881310a22b646042a3bbaf3dbc07f4cdfcb.tar.bz2
dotfiles-bsd-afb17881310a22b646042a3bbaf3dbc07f4cdfcb.tar.xz
dotfiles-bsd-afb17881310a22b646042a3bbaf3dbc07f4cdfcb.tar.zst
dotfiles-bsd-afb17881310a22b646042a3bbaf3dbc07f4cdfcb.zip
up
Diffstat (limited to '.local/bin/fetch_mail')
-rwxr-xr-x.local/bin/fetch_mail14
1 files changed, 9 insertions, 5 deletions
diff --git a/.local/bin/fetch_mail b/.local/bin/fetch_mail
index 0d35cf5..0a88914 100755
--- a/.local/bin/fetch_mail
+++ b/.local/bin/fetch_mail
@@ -6,10 +6,14 @@ use Env qw(HOME);
use constant MC_FILE_PATH => '/tmp/mc_';
-sub get_all_accs
+sub get_all_accounts
{
- opendir(my $dh, $ENV{'MAIL'});
- return;
+ my @accs;
+
+ opendir(my $dh, $ENV{'MAIL'}) or die $!;
+ @accs = readdir($dh);
+ closedir($dh);
+ return @accs;
}
sub count_new_mails
@@ -32,9 +36,9 @@ sub fetch_mail
$ENV{'GNUPGHOME'} = $HOME . '/.local/share/gnupg';
$ENV{'PASSWORD_STORE_DIR'} = $HOME . '/.local/share/pass';
my $maildir = $ENV{'MAIL'} . '/';
- # my @accs = (ACCOUNTS);
- get_all_accs();
+ my @accs = get_all_accounts();
+ print @accs;
# my $mc_file = MC_FILE_PATH . $accs[0];
# my $pre_count = count_new_mails($accs[0], $maildir);
# print $pre_count . "\n";