procmail
[Top] [All Lists]

RE: extracting the TO username

2000-05-16 04:05:11

Since I don't want to pipe the message to the program I tried the following
instead but it didn't work:

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

I also saw some related hints in the mailing list archive and tried the
following, which also did not work:

:0
* ^To:[ ]*\/[^  ].*
! `myscript "$MATCH"`

Any other suggestions?

Thanks,
_Rav.


-----Original Message-----
From: Lee Howard [mailto:faxguy(_at_)server(_dot_)deanox(_dot_)com]
Sent: Tuesday, May 16, 2000 1:19 AM
To: rsahuja(_at_)julian(_dot_)uwo(_dot_)ca
Subject: Re: extracting the TO username


Try

:0
* ^TO_\/
| myscript "$MATCH"

Lee Howard

(of course, I haven't tried this.  I'm just reading a suggestion from page
14 of man procmailrc and associating it with the MATCH definition on page
9.)


At 03:49 AM 5/15/00 -0400, you wrote:

I am trying to write a recipe that gets the USERNAME from the "To" field
(or
Received for) of the incoming message, passes it to a program which
accesses
a database and returns an address to procmail to forward the email.

That is, if the incoming email is meant for abc(_at_)mydomain(_dot_)com I want 
the
recipe to be able to extract "abc" (what I referred to as USERNAME ealier)
and pass it as a parameter to the program. My program then returns
xyz(_at_)somedomain(_dot_)com(_dot_)

So something like this should do the trick:

:0
! `myscript "$USERNAME"`

But I can't figure out how to extract the $USERNAME before passing it to
the
database program. Any hints on how to do this would be greatly appreciated.

BTW, I realize that ideally I should be using the MTA to do this, but we
use
vitual domain hosting and don't have access to sendmail's virtualusertable,
etc.

Thanks,

_Rav.






________________________________________________________
                          1stUp.com - Free the Web
  Get your free Internet access at http://www.1stUp.com





________________________________________________________
                           1stUp.com - Free the Web
   Get your free Internet access at http://www.1stUp.com

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