procmail
[Top] [All Lists]

Re: formail oddity

2005-04-22 08:27:09
On 4/22/05, Dallman Ross <dman(_at_)nomotek(_dot_)com> wrote:
On Thu, Apr 21, 2005 at 07:42:14PM -0700, Bart Schaefer wrote:

If you have any other suggestions, feel free to send them my way.
[The] practical question [is] how best to code into a shell script the
multiple options you cite above.

You don't really need to code in *all* the possibilities; you just
need to know whether the input is *empty*, not whether it's a
multi-message file, because formail works fine with the edge case of a
single-message file.

So something along the lines of
  if test -s $INPUTFILENAME
  then FORMAIL="formail -s"
  # else FORMAIL=
  fi
  $FORMAIL procmail .... < $INPUTFILENAME


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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