procmail
[Top] [All Lists]

Best way to extra To: address?

1999-02-12 08:09:05
Howdy,

Frequently, I want to extract just the user(_at_)host portion of the To: address
for use in my procmail recipes.  That is, given something like this:

  To: Lars Kellogg-Stedman <lars(_at_)larsshack(_dot_)org>

I just want:

  lars(_at_)larsshack(_dot_)org

My current solution looks something like this:

  :0
  TO=|formail -I From -R To: From: | formail -rtzx To:

This deletes the "From " and "From:" fields, renames the existing To: field
to From:, and then uses formail -r to generate a reply header and grabs the
new To: header from that.

Which works, but isn't all that pretty.  Is there a better way? 

-- Lars

-- 
Lars Kellogg-Stedman <lars(_at_)larsshack(_dot_)org>

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