***error: There is no valid email in the directories at /usr/local/bouncehammer/bin/mailboxparser line 174 error対策

処理するメールがないと下記エラーがでます

***error: There is no valid email in the directories at /usr/local/bouncehammer/bin/mailboxparser line 174

これを避けるまめに、フォルダー内にデータがある時だけ、
(新規メールが届いている時だけ)
処理を行うようにする

if ls  /フォルダーのバス/*.* > /dev/null 2>&1
  then
   :  フォルダーにデータがある場合に処理する
fi

機能を追加する

vi /usr/local/autobonuc.sh

#!/bin/sh
 if ls  /home/user0xxx/Maildir/new/*.* > /dev/null 2>&1
  then
/usr/local/bouncehammer/bin/mailboxparser -g --log /home/user031/Maildir/new --remove
/usr/local/bouncehammer/bin/logger -c --remove

for f in /usr/local/bouncehammer/var/log/*.log
do
  /usr/local/bouncehammer/bin/databasectl --update $f
done

fi