[mail] enhance scan for new mail
take everything into account, but trash
This commit is contained in:
parent
a1386ad08c
commit
fea6a564d7
@ -40,7 +40,7 @@ messageinfo() {
|
|||||||
syncandnotify() {
|
syncandnotify() {
|
||||||
acc="$(echo "$account" | sed "s/.*\///")"
|
acc="$(echo "$account" | sed "s/.*\///")"
|
||||||
mbsync "$acc"
|
mbsync "$acc"
|
||||||
new="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/$acc/[Ii][Nn][Bb][Oo][Xx]/new/* -type f -newer "${XDG_CONFIG_HOME:-$HOME/.config}/mutt/.mailsynclastrun" 2>/dev/null)"
|
new="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/$acc/*/new/ -type f -newer "${XDG_CONFIG_HOME:-$HOME/.config}/mutt/.mailsynclastrun" | grep -iv "trash" 2>/dev/null)"
|
||||||
newcount=$(echo "$new" | sed '/^\s*$/d' | wc -l)
|
newcount=$(echo "$new" | sed '/^\s*$/d' | wc -l)
|
||||||
if [ "$newcount" -gt "0" ]; then
|
if [ "$newcount" -gt "0" ]; then
|
||||||
for file in $new; do
|
for file in $new; do
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
unread=""
|
unread=""
|
||||||
for acc in $(ls "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/)
|
for acc in $(ls "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/)
|
||||||
do
|
do
|
||||||
new="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/$acc/[Ii][Nn][Bb][Oo][Xx]/new/* -type f | wc -l 2>/dev/null)"
|
new="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/$acc/*/new/ -type f | grep -iv "trash" | wc -l 2>/dev/null)"
|
||||||
if [ $new -gt 0 ]; then
|
if [ $new -gt 0 ]; then
|
||||||
[ -n "$(echo "$acc" | sed -n '/@etu/p')" ] && box=""
|
[ -n "$(echo "$acc" | sed -n '/@etu/p')" ] && box=""
|
||||||
[ -n "$(echo "$acc" | sed -n '/@mailo/p')" ] && box=""
|
[ -n "$(echo "$acc" | sed -n '/@mailo/p')" ] && box=""
|
||||||
|
Reference in New Issue
Block a user