06-24-2008
Here is the output of one match to that grep (it has been obfuscated):
Quote:
Delivered-To: xx@xx
Received: from gmail-pop.l.google.com [72.14.205.111]
by xx with POP3 (fetchmail-6.3.8)
for <xx@localhost> (single-drop); Tue, 24 Jun 2008 11:28:22 -0400 (EDT)
Received: by xx with SMTP id i17cs35177and;
Tue, 24 Jun 2008 08:42:03 -0700 (PDT)
Received: by xx with SMTP id j5mr16112468anc.3.1214322113210;
Tue, 24 Jun 2008 08:41:53 -0700 (PDT)
Return-Path: <root@xx>
Received: from xx (xx [xx])
by mx.google.com with ESMTP id z52si2728230pyg.1.2008.06.24.08.41.49;
Tue, 24 Jun 2008 08:41:52 -0700 (PDT)
Received-SPF: pass (google.com: domain of root@xx designates xx as permitted sender) client-ip=xx;
Authentication-Results: mx.google.com; spf=pass (google.com: domain of root@xx designates xx as permitted sender) smtp.mail=root@xx
Return-Path: <root@xx>
Received: from [xx] ([2xx:41897] helo=xx)
by xx (envelope-from <root@xx>)
(xx 2.2.1.21 r(19176)) with ESMTP
id 40/AB-02382-59511684; Tue, 24 Jun 2008 11:41:14 -0400
Received: from xx ([xx] helo=xx)
by xx with esmtp (xx 4.51)
id 1KBAdl-0001GL-2O
for xx@xx; Tue, 24 Jun 2008 11:41:05 -0400
Received: from [xx] ([xx:56919] helo=xx)
by xx (ecelerity 2.1.1.23 r(18304)) with ESMTP
id BD/75-07415-09511684 for <xx>; Tue, 24 Jun 2008 11:41:04 -0400
Received: by xx (Postfix, from userid 0)
id B46B9103AB; Tue, 24 Jun 2008 11:41:02 -0400 (EDT)
Subject: [xxx] xxx
Cc: xx
From: xx
Message-Id: <20080624154102.B46B9103AB@xx>
Date: Tue, 24 Jun 2008 11:41:02 -0400 (EDT)
76.11.221.51
The IP is always at the end of the match/email (the e-mails are text files generated by fetchmail); normally there are multiple IPs, but it's always one IP per line.
Last edited by laebshade; 06-24-2008 at 01:15 PM..
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
hi forums
i need help with a little problem i am having.
i need to count the number of fields that are in a saved variable so i can use that number to make a different function work properly.
is there a way of doing this without using SED/AWK?
anything would be greatly appreciated (4 Replies)
Discussion started by: strasner
4 Replies
2. Shell Programming and Scripting
I currently use LaTeX together with a sed script to set cloze test papers for my students. I currently pepend and equals sign to the front of the words I want to leave out in the finished test, =perpendicular, for example. I am able to number the blanks using a variable in LaTeX. I would like to... (8 Replies)
Discussion started by: maouinin
8 Replies
3. UNIX for Advanced & Expert Users
Please find the input file as given below:
2012/02/29 11:00:00~~CRITICAL~For customer 00000476 no daily files were found in the 010137933 account directory.
2012/02/29 11:00:00~~CRITICAL~For customer 05006802 no daily files were found in the 010115166 account directory.
2012/02/29... (0 Replies)
Discussion started by: av_sagar
0 Replies
4. Shell Programming and Scripting
We have the following output:
server1_J00_data_20120711122243
server1_J00_igs_20120711122243
server1_J00_j2ee_20120711122243
server1_J00_sec_20120711122243
server1_J00_data_20120711131819
server1_J00_igs_20120711131819
server1_J00_j2ee_20120711131819
server2_J00_data_20120711122245... (10 Replies)
Discussion started by: ux4me
10 Replies
5. Shell Programming and Scripting
I have a file of 100,000 lines in the below format:
answer.bed
chr1 957570 957852
NOC2L
chr1 976034 976270
PERM1
chr1 976542 976787
PERM1
I need to get each on one line and so far what I have tried doesn't seem to be working. Thank you... (3 Replies)
Discussion started by: cmccabe
3 Replies
6. Shell Programming and Scripting
The awk below runs and produces the following output on the file2. This is just an example of the format as the file is ~14MB. file1.txt is attached. I am trying to count the ids that match between the two files and out the ids that are missing. Thank you :).
file2
970 NM_213590 ... (2 Replies)
Discussion started by: cmccabe
2 Replies
7. Solaris
Hello dears
how to assign IPv4 and IPv6 addresses with same interface on solaris 10 (1 Reply)
Discussion started by: ttashman
1 Replies
8. Shell Programming and Scripting
In the below awk I am trying output to one file those lines that match between $2,$3,$4 of file1 and file2 with the count in (). I am also trying to output those lines that are missing between $2,$3,$4 of file1 and file2 with the count of in () each. Both input files are tab-delimited, but the... (7 Replies)
Discussion started by: cmccabe
7 Replies
9. UNIX for Beginners Questions & Answers
Hi Friends ,
I am having one problem as stated file .
Having an input CSV file as shown in the code
U_TOP_LOGIC/U_HPB2/U_HBRIDGE2/i_core/i_paddr_reg_2_/Q,1,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,1,1,0,0,0,0... (4 Replies)
Discussion started by: kshitij
4 Replies
10. UNIX for Beginners Questions & Answers
Hi,
I have a file with a list of bunch of IP addresses from different VLAN's . I am trying to find the list the number of each vlan occurence in the output
Here is how my file looks like
1.1.1.1
1.1.1.2
1.1.1.3
1.1.2.1
1.1.2.2
1.1.3.1
1.1.3.2
1.1.3.3
1.1.3.4
So what I am trying... (2 Replies)
Discussion started by: new2prog
2 Replies
LEARN ABOUT DEBIAN
mail::field::received
Received(3pm) User Contributed Perl Documentation Received(3pm)
NAME
Mail::Field::Received -- mostly RFC822-compliant parser of Received headers
SYNOPSIS
use Mail::Field;
my $received = Mail::Field->new('Received', $header);
my $results = $received->parse_tree();
my $parsed_ok = $received->parsed_ok();
my $diagnostics = $received->diagnostics();
DESCRIPTION
Don't use this class directly! Instead ask Mail::Field for new instances based on the field name!
Mail::Field::Received provides subroutines for parsing Received headers from e-mails. It mostly complies with RFC822, but deviates to
accommodate a number of broken MTAs which are in common use. It also attempts to extract useful information which MTAs often embed within
the "(comments)".
It is a subclass derived from the Mail::Field and Mail::Field::Generic classes.
ROUTINES
o debug
Returns current debugging level obtained via the "diagnostics" method. If a parameter is given, the debugging level is changed. The
default level is 3.
o diagnose
$received->diagnose("foo", "
");
Appends stuff to the parser's diagnostics buffer.
o diagnostics
my $diagnostics = $received->diagnostics();
Returns the contents of the parser's diagnostics buffer.
o parse
The actual parser. Returns the object (Mail::Field barfs otherwise).
o parsed_ok
if ($received->parsed_ok()) {
...
}
Returns true if the parse succeed, or if it failed, but was permitted to fail for some reason, such as encountering evidence of a known
broken (non-RFC822-compliant) format mid-parse.
o parse_tree
my $parse_tree = $received->parse_tree();
Returns the actual parse tree, which is where you get all the useful information. It is returned as a hashref whose keys are strings
like `from', `by', `with', `id', `via' etc., corresponding to the components of Received headers as defined by RFC822:
received = "Received" ":" ; one per relay
["from" domain] ; sending host
["by" domain] ; receiving host
["via" atom] ; physical path
*("with" atom) ; link/mail protocol
["id" msg-id] ; receiver msg id
["for" addr-spec] ; initial form
";" date-time ; time received
The corresponding values are more hashrefs which are mini-parse-trees for these individual components. A typical parse tree looks
something like:
{
'by' => {
'domain' => 'host5.hostingcheck.com',
'whole' => 'by host5.hostingcheck.com',
'comments' => [
'(8.9.3/8.9.3)'
],
},
'date_time' => {
'year' => 2000,
'week_day' => 'Tue',
'minute' => 57,
'day_of_year' => '1 Feb',
'month_day' => ' 1',
'zone' => '-0500',
'second' => 18,
'hms' => '21:57:18',
'date_time' => 'Tue, 1 Feb 2000 21:57:18 -0500',
'hour' => 21,
'month' => 'Feb',
'rest' => '2000 21:57:18 -0500',
'whole' => 'Tue, 1 Feb 2000 21:57:18 -0500'
},
'with' => {
'with' => 'ESMTP',
'whole' => 'with ESMTP'
},
'from' => {
'domain' => 'mediacons.tecc.co.uk',
'HELO' => 'tr909.mediaconsult.com',
'from' => 'tr909.mediaconsult.com',
'address' => '193.128.6.132',
'comments' => [
'(mediacons.tecc.co.uk [193.128.6.132])',
],
'whole' => 'from tr909.mediaconsult.com (mediacons.tecc.co.uk [193.128.6.132])
'
},
'id' => {
'id' => 'VAA24164',
'whole' => 'id VAA24164'
},
'comments' => [
'(mediacons.tecc.co.uk [193.128.6.132])',
'(8.9.3/8.9.3)'
],
'for' => {
'for' => '<adam@spiers.net>',
'whole' => 'for <adam@spiers.net>'
},
'whole' => 'from tr909.mediaconsult.com (mediacons.tecc.co.uk [193.128.6.132]) by host5.hostingcheck.com (8.9.3/8.9.3) with ESMTP id VAA24164 for <adam@spiers.net>; Tue, 1 Feb 2000 21:57:18 -0500'
}
BUGS
Doesn't use Parse::RecDescent, which it maybe should.
Doesn't offer a `strict RFC822' parsing mode. To implement that would be a royal pain in the arse, unless we move to Parse::RecDescent.
SEE ALSO
Mail::Field, Mail::Header
AUTHOR
Adam Spiers <adam@spiers.net>
LICENSE
All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.10.1 2011-02-05 Received(3pm)