Hi

I'm struggling with procmail - as a complete newbie I should add.

Basically the pseudo code for what I want is as follows:

extract string from header.

if length($string) < 6
  pad $string left spaces to 6;
if test -d $string
  file the email into the folder $string
else
  forward to bad_folders alias;

What I have so far is:

:0
* ^X-My-Header:[ \t]*\/$
{
  STRING=${MATCH}
  :0
  * ? test ! -d $MATCH
  {
     ! bad_folder
  }
  $MATCH
}

I've managed to fudge my way so far with lot's of help from the Search Engine Gods, but I'm stuck on the "pad" problem. I know I could write this as a shell script or a perl snippet and then pipe the value of the variable out to it but how do I get it back in again (or alternatively how do I do it within procmail?

TIA

Nigel

--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to