procmail
[Top] [All Lists]

Re: Field TO:, again

2000-11-22 23:55:24
On Thu, Nov 23, 2000 at 01:13:18AM -0000, Paulo Franco wrote:
Hello again,
What ia wanto is to put field TO: from de header into a variable, using
formail, or anything else.
Supose i receve a mail, but my email address cames in the cc field.
So i would like to get the field TO: into a variable so that i can know who
recived the mail too. How can i do it?
Was it more explicit now!?
Hope so...
Can you help me! Thanks!

First, let me check that I correctly what you're trying to do.
You expect that you will receive some mail where you were a Cc or Bcc
recipient, and therefor the mail was "To:" someone else. You would like to
extract the address in the To: field and put it in a variable.
Do I understand correctly?

Operating on that assumption, it's fairly simple.

:0
* ^To:[         ]\/.*
VARIABLE=$MATCH

[ ] contains a space and a tab.
This will, of course, put all recipients in the To: field into VARIABLE. It
will also not make the value of VARIABLE a strict rfc822 email address
<user(_at_)host(_dot_)domain>. The "comment" portion of the email address/es 
will remain.

-- 
Andrew Edelstein                http://andrew.pure-chaos.com

"I've learned not to put things in my mouth that are bad for me"
                                Monica Lewinsky on Jenny Craig
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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