procmail
[Top] [All Lists]

Re: send file [size] recipe wanted

1996-03-21 22:01:49
David W. Tamkin wrote:

| I need to pick apart variables from the subject line, so I need a way of
| parsing out each WORD (space-separated) into diff. variables.

That's what the MATCH facility is for.  It came in around version 3.06.

I know, but it stumps me as yet when I try to make it pull apart words...

I do something similar (getting each word of a line into a variable, using
$MATCH) to parse the From_ line for date information when I want recipes to
turn on or off automatically at predetermined dates and times.

I'd like to see this privately, if not on the list.

It's a matter of getting the regexps right, and I don't know what kind of
text you'll be looking through.  Remember that procmail looks for the
shortest left side and longest right side when it sets $MATCH.

Ah...  Well, that's the hard part...  Here's what I really want...

If a msg. comes in (any body or none), and the subject BEGINS "send ", I
want it to parse out the rest as in this example:

send uuencode sat-am.zip 1000

Word 2, 'uuencode', is the format I need to parse out in some way...  (Only
other I'll deal with is MIME, but I suppose I could do this with a simple
recipe, so don't need this in a var., really...)

Word 3 is the filename, and it can and will change AT WILL...  I need a bit
of unpredictability here.  (However, my known (so far!) extensions will
either be .zip or .txt.)

Word 4 will be a split size, which I'll prob. only use on uuencode, and
needs to represent the number of lines to split the encoding at.


I'll have no probs. with the rest of the recipe...  Just the MATCH part is
the puzzle.

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