Debian - Add the checking mail notification - mutt

add checking mail notification

Add the checking mail notification for Mutt - 为Mutt添加新邮件提醒

通过mailcheck

Install the notify-send app, in Debian, the package is libnotify-bin

$sudo aptitude install libnotify-bin

Install mailcheck app

$sudo aptitude install mailcheck

Configure the mailcheck

Create the file: ~/.mailcheckrc, and add the following lines:

$(HOME)/mail/inbox
$(HOME)/mail/work

Write shell script. to monite the mail

Here is the shell file content

#/bin/bash

last=0
cur=0

while [ : ]
do
    mailcheck | grep new 2>&1 >/dev/null
    if [ $? -eq 0 ]
    then
        cur=$(mailcheck  | awk 'BEGIN {sum=0} ; $4~/new/ {sum=sum+1}; END {print sum}')
        if [ $cur -ne $last ]
        then
            notify-send -i "/usr/share/pixmaps/mutt.xpm" "New Mail: $cur"
            last=$cur
        fi
    fi
    sleep 300
done

Auto run script. when login

Add the following line into your .bashprofile

. ~/mail/mail-notify.sh &

通过mail-notification

看来是我太原始了,才发现mail-notification这个好东西,几乎不需要配置

安装

$sudo aptitude install mail-notification

启动软件

打开 应用程序-互联网-Mail Notification

配置

配置相当简单,类型选择autodetected,路径选择mail文件夹,比如/home/shine/mail/work,搞定

Author: Shine Zhong

Date: 2011-01-11 16:49:18 CST

HTML generated by org-mode 7.4 in emacs 23

请使用浏览器的分享功能分享到微信等