procmail
[Top] [All Lists]

Re: extracting the TO username

2000-05-18 07:31:57
Lee suggested to Rav,

| :0

An 'i' flag  would be a good idea there, since mysccript is not going to read
the message as stdin.

| * ^TO_\/*

Has to be .*; don't confuse shell globbing patterns with regexp syntax (yes,
the sublte differences do take some time to get used to).

| USERNAME=`myscript "$MATCH"`

That should be 

  USERNAME=| myscript "$MATCH"

| {

You can't have a left brace hanging loose like that.  It has to be the
action line of a recipe.

|  :0
|  * ^Subject:.*test
|  ! $USERNAME
| }

So legit syntaxes would be

  :0i
  * ^TO_\/.*
  * ^Subject:.*test
  USERNAME=| myscript "$MATCH"
   :0a
   ! $USERNAME

or

  :0
  * ^TO_\/.*
  * ^Subject:.*test
  {
   USERNAME=`myscript "$MATCH"`

   :0
   ! $USERNAME
  }

Just from looking at it, I would not be too confident about this:

  :0
  * ^Subject:.*test
  * ^TO_\/.*
  ! `myscript "$MATCH"`

because then myscript and the MTA would be fighting over trying to get the
message text as stdin, and I'm not sure what the results would be.

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