procmail
[Top] [All Lists]

Re: splitting large mail msgs. (silver)

1999-12-12 08:12:04
On Sun, 12 Dec 1999 00:14:47 -0800 (PST), Silver 
<Savinien(_at_)excite(_dot_)com>
wrote:
PATH=/usr/bin

Now, that's minimalistic. Procmail starts up with a PATH which is
richer than that. Any particular reason you want to exclude /bin and
the other directories which are in PATH by default? :-)/2

(Actually the default PATH is a little weird. /usr/bin/X11 but no
/usr/bin? I wonder what Stephen might have been thinking.)

SPLISIZE=140
MYADDR=josh(_at_)mobile(_dot_)net
ALTADDR=savinien(_at_)excite(_dot_)com

:0 c
* > $SPLITSIZE
* !^X-Loop:.*$MYADDR
| formail -rI"To: $ALTADDR" -A"X-Loop: $MYADDR" | splitmail -d -i split

Did I make some sort of conflicting mistake somewhere?

This is a frequent newbie problem: You need a $ modifier in order to
actually interpolate variable values into conditions. I would have
thought this applied to the > $SPLITSIZE condition, too, but actually
that works fine with just a single dollar sign. However, the log file
should read "Match on > 140" and not just "Match on > "; this should
already have made you suspect a typo. (The typo was already pointed
out earlier.) But you do need the dollar interpolation on the second
condition:

    :0c
    * > $SPLITSIZE
    * $ ! ^X-Loop:.*$\MYADDR
    | formail -r -I"To: $ALTADDR" -A "X-Loop: $MYADDR" \
        | splitmail -d -i split

The $\VAR form is special to Procmail and means that the interpolated
value should have any regex special characters escaped (so . will turn
into \. etc -- as you know, an unescaped period means "match any
non-newline character" in regular expression language).

Like I already wrote to you in a private message, some good starting
points for pager recipes are on the Procmail Links page in the
"Pearls" section; <http://www.iki.fi/era/procmail/links.html>

Hope this helps,

/* era */

-- 
 Too much to say to fit into this .signature anyway: <http://www.iki.fi/era/>
  Fight spam in Europe: <http://www.euro.cauce.org/> * Sign the EU petition

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