diff options
author | joe <rbo@gmx.us> | 2025-10-03 11:31:23 +0200 |
---|---|---|
committer | joe <rbo@gmx.us> | 2025-10-03 11:31:23 +0200 |
commit | 5eb6cf043930ffc230c1681bd61e7d283f6ee537 (patch) | |
tree | e45c48534019b3cd16aad2b8ac2d20e8b9d48263 /.local/bin/fetch_mail | |
parent | up (diff) | |
download | dotfiles-bsd-5eb6cf043930ffc230c1681bd61e7d283f6ee537.tar.gz dotfiles-bsd-5eb6cf043930ffc230c1681bd61e7d283f6ee537.tar.bz2 dotfiles-bsd-5eb6cf043930ffc230c1681bd61e7d283f6ee537.tar.xz dotfiles-bsd-5eb6cf043930ffc230c1681bd61e7d283f6ee537.tar.zst dotfiles-bsd-5eb6cf043930ffc230c1681bd61e7d283f6ee537.zip |
up
Diffstat (limited to '')
-rwxr-xr-x | .local/bin/fetch_mail | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/.local/bin/fetch_mail b/.local/bin/fetch_mail index 2002ce3..0c743ec 100755 --- a/.local/bin/fetch_mail +++ b/.local/bin/fetch_mail @@ -26,7 +26,10 @@ sub get_new_mail my $ret; system('killall mbsync >/dev/null 2>&1'); - system('mbsync', $acc); + $ret = system('mbsync', 'qwe'); + if ($ret != 0) { + notify(" $acc: failed to sync mails"); + } return; } @@ -56,6 +59,20 @@ sub count_new_mails sub fetch_thread { + return; +} + +sub fetch_mail +{ + $ENV{'MAIL'} = $HOME . '/.local/share/mail'; + $ENV{'GNUPGHOME'} = $HOME . '/.local/share/gnupg'; + $ENV{'PASSWORD_STORE_DIR'} = $HOME . '/.local/share/pass'; + my $maildir = $ENV{'MAIL'} . '/'; + # my $notify_str = " new mails\n"; + + # test gpg + my @accs = get_all_accounts(); + foreach (@accs) { my $pre_count = -1; my $mc_file = MC_FILE_PATH . $_; my $fh; @@ -79,21 +96,6 @@ sub fetch_thread seek($fh, 0, 0); print $fh "$post_count"; close($fh); - return; -} - -sub fetch_mail -{ - $ENV{'MAIL'} = $HOME . '/.local/share/mail'; - $ENV{'GNUPGHOME'} = $HOME . '/.local/share/gnupg'; - $ENV{'PASSWORD_STORE_DIR'} = $HOME . '/.local/share/pass'; - my $maildir = $ENV{'MAIL'} . '/'; - # my $notify_str = " new mails\n"; - my $og_length = length($notify_str); - - # test gpg - my @accs = get_all_accounts(); - foreach (@accs) { } # notify($notify_str) if (length($notify_str) > $og_length); return; |