issue getting unseen count from a mailbox
26 Nov
2025
26 Nov
'25
10:46 a.m.
Hi,
I'm using wmbiff to monitor my imap mailboxes with a script that polls every minute:
eval "ssh $WMHOST \"doveadm mailbox status -u ldm 'messages unseen' $(printf %q "$WMBOX")\" 2>/dev/null" |
awk -F'[ =]' '{old=$3; new=$5} END {print old, new+0}' |
{ read old new; if [ $new -gt 0 ] ;then echo $new new; else echo $old; fi; }
If I haven't polled the mailbox before with mutt or another MUA then only the total message count will be returned, however if I peek at the mailbox with a MUA (without looking at any message) then the script returns the new message count.
How can I have dovecot (2.4.1 debian) always return the unseen message count in any case?
Thanks,
1
Age (days ago)
1
Last active (days ago)
0 comments
1 participants
participants (1)
-
Louis-David Mitterrand