From e6c6d633c6b910f29e26fa697995b2e89cbab1b1 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Thu, 7 Feb 2013 08:54:55 -0600 Subject: [PATCH] * usr/lib/byobu/mail: LP: #1118364 - support maildir format --- debian/changelog | 3 ++- usr/lib/byobu/mail | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 1bdebed6..0b3a4d16 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,7 @@ byobu (5.32) unreleased; urgency=low - * UNRELEASED + * usr/lib/byobu/mail: LP: #1118364 + - support maildir format -- Dustin Kirkland Wed, 06 Feb 2013 23:16:22 -0600 diff --git a/usr/lib/byobu/mail b/usr/lib/byobu/mail index 5d9bab84..017bb278 100755 --- a/usr/lib/byobu/mail +++ b/usr/lib/byobu/mail @@ -22,11 +22,14 @@ MAILFILE="/var/spool/mail/$USER" __mail_detail() { - [ -s "$MAILFILE" ] && ls -alF "$MAILFILE" 2>&1 + [ ! -d "$MAILFILE" ] && [ -s "$MAILFILE" ] && ls -alF "$MAILFILE" 2>&1 + [ -d "$MAILFILE/new" ] && ls -AlF "$MAILFILE/new" 2>&1 } __mail() { - if [ -s "$MAILFILE" ]; then + if [ -f "$MAILFILE" ] && [ -s "$MAILFILE" ]; then + color b; printf "%s" "$ICON_MAIL"; color -- + elif [ -d "$MAILFILE/new" ] && "$(ls -A "$MAILFILE/new" 2>/dev/null)"; then color b; printf "%s" "$ICON_MAIL"; color -- else rm -f "$BYOBU_RUN_DIR/status.$BYOBU_BACKEND/mail"*