Re: need help parsing Received-SPF header
- From: Ed Morton <morton@xxxxxxxxxxxxxx>
- Date: Wed, 18 Oct 2006 07:11:35 -0500
moody wrote:
Please don't top-post. Fixed below.
On Oct 18, 2:17 am, calm...@xxxxxxxxx wrote:
Using sed or awk or another such shell tool, how can I extract only the
email address from a "Received-SPF" header in a mail message?
Seehttp://www.openspf.org/newheader.htmlfor examples of what this
header looks like.
You MAY want to post a small sample input and expected output here rather than asking people to go look at some URL.
As you can see, the email address
(myn...@xxxxxxxxxxx) appears in different parts of the header and is
bounded sometimes by a character like ":" or ")" and sometimes by just
whitespace. Seems like a pretty challenging regex to me to get right.
Can anyone help?
What output you exactly want from the resulting email headers, I
suppose you want only the line containing/begining with Received-SPF
u might consider this
awk '/Received-SPF/ { print $0 } '
If that does what the OP wants, it can be written as just:
awk '/Received-SPF/'
since printing $0 is awks default action on a true condition.
Ed.
.
- Follow-Ups:
- Re: need help parsing Received-SPF header
- From: calmasy
- Re: need help parsing Received-SPF header
- References:
- need help parsing Received-SPF header
- From: calmasy
- Re: need help parsing Received-SPF header
- From: moody
- need help parsing Received-SPF header
- Prev by Date: Re: need help parsing Received-SPF header
- Next by Date: Re: How to escape "\a" "\b" "\c" "\f" "\n" "\r" "\t" "\v" in the string output?
- Previous by thread: Re: need help parsing Received-SPF header
- Next by thread: Re: need help parsing Received-SPF header
- Index(es):
Relevant Pages
|