Email-Received
view release on metacpan or search on metacpan
t/rcvd_parser.t view on Meta::CPAN
#!/usr/bin/perl
use Test::More tests => 48;
use_ok("Email::Received");
use_ok("Email::Simple");
use strict;
my %data = (
# format is:
# q{ ...received hdrs sample... } => q{ [ expected string, normalized ] },
# ....
# (normalized == s/\s+/ /gs;)
q{
Received: (qmail 10681 invoked by uid 404); 14 Nov 2003 08:05:52 -0000
Received: from postfix3-2.free.fr (foobar@213.228.0.129)
by totor.example.net with SMTP; 14 Nov 2003 08:05:50 -0000
Received: from asterix.laurier.org (lns-p19-8-82-65-66-244.adsl.proxad.net [82.65.66.244])
by postfix3-2.free.fr (Postfix) with ESMTP id 7BACDC372
for <somelist@example.net>; Fri, 14 Nov 2003 09:05:49 +0100 (CET)
} => q{
[ ip=213.228.0.129 rdns=postfix3-2.free.fr helo=postfix3-2.free.fr by=totor.example.net ident=foobar envfrom= id= auth= ] [ ip=82.65.66.244 rdns=lns-p19-8-82-65-66-244.adsl.proxad.net helo=asterix.laurier.org by=postfix3-2.free.fr ident= envfrom= id=...
},
q{
Received: from 0 ([61.31.135.91]) by bass.bass.com.eg with Microsoft SMTPSVC(5.0.2195.6713);
Tue, 21 Sep 2004 08:59:06 +0300
} => q{
[ ip=61.31.135.91 rdns= helo=0 by=bass.bass.com.eg ident= envfrom= intl=0 id= auth= ]
},
q{
Received: from helene8.i.pinwand.net (helene.cats.ms) [10.0.8.6.13219] (mail)
by lisbeth.i.pinwand.net with esmtp (Exim 3.35 #1 (Debian))
id 1CO5y7-0001vC-00; Sun, 31 Oct 2004 04:01:23 +0100
} => q{
[ ip=10.0.8.6 rdns=helene8.i.pinwand.net helo=helene.cats.ms by=lisbeth.i.pinwand.net ident= envfrom= intl=0 id=1CO5y7-0001vC-00 auth= ]
},
q{
Received: from inet-vrs-05.redmond.corp.microsoft.com ([157.54.6.157])
by INET-IMC-05.redmond.corp.microsoft.com with Microsoft
SMTPSVC(5.0.2195.6624); Thu, 6 Mar 2003 12:02:35 -0800
} => q{
[ ip=157.54.6.157 rdns= helo=inet-vrs-05.redmond.corp.microsoft.com by=INET-IMC-05.redmond.corp.microsoft.com ident= envfrom= id= auth= ]
},
q{
Received: from tthompson ([217.35.105.172] unverified) by
mail.neosinteractive.com with Microsoft SMTPSVC(5.0.2195.5329);
Tue, 11 Mar 2003 13:23:01 +0000
} => q{
[ ip=217.35.105.172 rdns= helo=tthompson by=mail.neosinteractive.com ident= envfrom= id= auth= ]
},
q{
Received: from mx56.pirmateh.us (64.119.196.56.rev.iwaynetworks.com
[64.119.196.56] (may be forged))
by mail.core.obfugenedata.com (8.13.1/8.13.1) with ESMTP id i8FJcSRZ007847
for <othmar.pfannes@obfugenedata.com>; Wed, 15 Sep 2004 21:38:31 +0200
} => q{
[ ip=64.119.196.56 rdns=64.119.196.56.rev.iwaynetworks.com helo=mx56.pirmateh.us by=mail.core.obfugenedata.com ident= envfrom= intl=0 id=i8FJcSRZ007847 auth= ]
t/rcvd_parser.t view on Meta::CPAN
},
q{
Received: from cs.helsinki.fi ([::ffff:218.11.152.141]) by mail.cs.helsinki.fi
with esmtp; Mon, 18 Aug 2003 15:37:48 +0300
Received: from m165.4superdeals.biz (softdnserr [::ffff:64.235.238.165]) by
mail.cs.helsinki.fi with esmtp; Sun, 17 Aug 2003 19:30:42 +0300
} => q{
[ ip=218.11.152.141 rdns= helo=cs.helsinki.fi by=mail.cs.helsinki.fi ident= envfrom= id= auth= ] [ ip=64.235.238.165 rdns= helo=m165.4superdeals.biz by=mail.cs.helsinki.fi ident= envfrom= id= auth= ]
},
q{
Received: from hotmail.com (bay1-f95.bay1.hotmail.com [65.54.245.95]) by Daffy.timing.com;
Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC;
Tue, 16 Mar 2004 18:12:31 -0800
Received: from 24.8.231.233 by by1fd.bay1.hotmail.msn.com with HTTP;
Wed, 17 Mar 2004 02:12:31 GMT
} => q{
[ ip=65.54.245.95 rdns=bay1-f95.bay1.hotmail.com helo=hotmail.com by=Daffy.timing.com ident= envfrom= id= auth= ] [ ip=24.8.231.233 rdns= helo= by=by1fd.bay1.hotmail.msn.com ident= envfrom= id= auth=HTTP ]
},
q{
Received: (qmail 22147 invoked by uid 526); 6 Feb 2005 21:11:38 -0000
Received: from 156.56.111.196 by blazing.arsecandle.org (envelope-from <gentoo-announce-return-530-rod=arsecandle.org@lists.gentoo.org>, uid 502) with qmail-scanner-1.24
(clamdscan: 0.80/594. f-prot: 4.4.2/3.14.11.
Clear:RC:0(156.56.111.196):.
Processed in 0.288806 secs); 06 Feb 2005 21:11:38 -0000
DomainKey-Status: no signature
Received: from lists.gentoo.org (HELO parrot.gentoo.org) (156.56.111.196)
by blazing.arsecandle.org with (DHE-RSA-AES256-SHA encrypted) SMTP; 6 Feb 2005 21:11:37 -0000
Received: (qmail 3988 invoked by uid 89); 6 Feb 2005 21:11:12 +0000
} => q{
[ ip=156.56.111.196 rdns=lists.gentoo.org helo=parrot.gentoo.org by=blazing.arsecandle.org ident= envfrom=gentoo-announce-return-530-rod=arsecandle.org@lists.gentoo.org id= auth= ]
},
q{
Received: from hotmail.com (something.com [65.54.245.95]) at just after 10pm by Daffy.timing.com on a Friday (CrazyMTA) (envelope-from <foo@example.com>) with TFTP
} => q{
[ ip=65.54.245.95 rdns=something.com helo=hotmail.com by=Daffy.timing.com ident= envfrom=foo@example.com id= auth= ]
},
q{
Received: from postfix3-2.free.fr (foobar@213.228.0.139)
by totor.example.net with SMTP; 14 Nov 2003 08:05:50 -0000
Received: from asterix.laurier.org (lns-p19-8-82-65-66-244.adsl.proxad.net [82.65.66.244])
by postfix3-2.free.fr (Postfix) with ESMTP id 7BACDC372
for <michel@example.net>; Fri, 14 Nov 2003 09:05:49 +0100 (CET)
} => q{
[ ip=213.228.0.139 rdns=postfix3-2.free.fr helo=postfix3-2.free.fr by=totor.example.net ident=foobar envfrom= id= auth= ] [ ip=82.65.66.244 rdns=lns-p19-8-82-65-66-244.adsl.proxad.net helo=asterix.laurier.org by=postfix3-2.free.fr ident= envfrom= id=...
},
q{
Received: from unknown (HELO feux01a-isp) (213.199.4.210)
by totor.example.net with SMTP; 1 Nov 2003 07:05:19 -0000
} => q{
[ ip=213.199.4.210 rdns= helo=feux01a-isp by=totor.example.net ident= envfrom= id= auth= ]
},
q{
Received: from x1-6-00-04-bd-d2-e0-a3.k317.webspeed.dk (benelli@80.167.158.170)
by totor.example.net with SMTP; 5 Nov 2003 23:18:42 -0000
} => q{
[ ip=80.167.158.170 rdns=x1-6-00-04-bd-d2-e0-a3.k317.webspeed.dk helo=x1-6-00-04-bd-d2-e0-a3.k317.webspeed.dk by=totor.example.net ident=benelli envfrom= id= auth= ]
},
q{
Received: from adsl-207-213-27-129.dsl.lsan03.pacbell.net (HELO merlin.net.au) (Owner50@207.213.27.129)
by totor.example.net with SMTP; 10 Nov 2003 06:30:34 -0000
} => q{
[ ip=207.213.27.129 rdns=adsl-207-213-27-129.dsl.lsan03.pacbell.net helo=merlin.net.au by=totor.example.net ident=Owner50 envfrom= id= auth= ]
},
q{
Received: from imo-m01.mx.aol.com ([64.12.136.4] verified)
by xxx.com (CommuniGate Pro SMTP 4.1.8)
with ESMTP id 875522 for yyy@xxx.com; Tue, 03 Feb 2004 08:37:38 -0800
Received: from Dwsf@aol.com
by imo-m01.mx.aol.com (mail_out_v36_r4.12.) id m.b9.3bfe3305 (4116)
for <Slowhand101967@aol.com>; Tue, 3 Feb 2004 11:14:06 -0500 (EST)
} => q{
[ ip=64.12.136.4 rdns= helo=imo-m01.mx.aol.com by=xxx.com ident= envfrom= id=875522 auth= ]
},
q{
Received: from bigass1.example.com ([66.199.2.3])
by slim1.example.com with esmtp; Tue, 06 Jan 2004 23:56:09 +0000
Received: from a1200 ([24.83.2.4])
(AUTH: LOGIN mitch@example.com)
by bigass1.example.com with esmtp; Tue, 06 Jan 2004 23:56:09 +0000
Received: from bigass1.example.com (ns1.example.com [66.199.2.5])
by fiat.example.edu (8.12.10/8.12.10) with ESMTP id
i06MBJ6U020255
( run in 2.125 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )