Hi,

I'm looking at implementing serialmail and am delivering out-going mail
to a maildir.

I'd like to run maildirsmtp as a cron job but only if any outgoing mail
exists, ie;

        if <any new mail in Maildir> then run maildirsmtp

What's the "best" way to check for new mail in a Maildir?

Currently I'm thinking of using a script something like this:

#!/bin/bash
if [  'ls ~alias/pppdir/new | wc -w' != "" ] ; then
  # run maildirsmtp here
fi

Is there a more elegant way to do this, ie is there an already-written
script/function that I don't know about?

Thanks,

R.
-- 
Me:                http://i.am/robin.bowes
Reeds Web Hosting: http://www.ReedsWeb.net
Order a Valentine: http://come.to/your.valentine
Ians.World:        http://ich.reedsweb.net/
                 Is this spam?
Two rules to success in life: 
  1. Don't tell people everything you know.
     -- Sassan Tat

Reply via email to