procmail
[Top] [All Lists]

Re: safey net for $MAILDIR

1999-09-10 00:56:43
On 10 September 1999, Timothy J Luoma <tjlists(_at_)bigfoot(_dot_)com> wrote:

everyone knows that a non-existent $MAILDIR is not a good thing.

is this an adequate method of protection?

:0w
* ! ? test -d "${MAILDIR}"
{
      LOG="
WARNING: no ${MAILDIR} found, will attempt to create          
"
      :0chi
      |mkdir "${MAILDIR}"
      
      :0ecw
      {
      
              LOG="

      *** CREATION OF $MAILDIR FAILED ***
      *** USING $HOME for $MAILDIR    ***

"
      MAILDIR="${HOME}"
      }
}     

    Not sure if it's adequate, but you probably want to use "mkdir -p"
instead of just "mkdir" (assuming, of course, that your mkdir supports
that).

    Regards,

    Liviu Daia

-- 
Dr. Liviu Daia               e-mail:   Liviu(_dot_)Daia(_at_)imar(_dot_)ro
Institute of Mathematics     web page: http://www.imar.ro/~daia
of the Romanian Academy      PGP key:  http://www.imar.ro/~daia/daia.asc

<Prev in Thread] Current Thread [Next in Thread>