Ok. I think simpler option here would be:
1. Assign the email header string to a variable. 2. Split the variable (using delimiter : ) and assign the list values to a hash. 3. Keys of this hash would be the field attributes and values would be the actual values. 4. You can then either apply regex on the value sor can directly get the desired value as per the requirement. Cheers, Parag On Tue, Oct 12, 2010 at 9:56 AM, S Pratap Singh <kdari...@gmail.com> wrote: > Here it is > ================ > Return-path: <no-re...@testdemo.com> > Envelope-to: sea...@example.com > Delivery-date: Sat, 14 Aug 2010 18:08:06 -0700 > Received: from localhost.localdomain ([127.0.0.1]:58763 > helo=[192.168.0.122]) > by server.example.com with esmtpa (Exim 4.69) > (envelope-from <no-re...@testdemo.com>) > id 1OkRhm-0001XX-DY > for sea...@example.com; Sat, 14 Aug 2010 18:08:06 -0700 > Received: from 192.68.0.34 ([192.68.0.34]) > (SquirrelMail authenticated user sea...@project.example.com) > by 192.168.0.122 with HTTP; > Sat, 14 Aug 2010 18:08:06 -0700 > Message-ID: <74e8b2237739aa507ffd1f8428cb3d1c.squir...@192.168.0.122> > Date: Sat, 14 Aug 2010 18:08:06 -0700 > Subject: "[65515 - Seeking - Reply] Need help" > From: no-re...@testdemo.com > To: sea...@example.com > User-Agent: SquirrelMail/1.4.20 > MIME-Version: 1.0 > Content-Type: text/plain;charset=iso-8859-1 > Content-Transfer-Encoding: 8bit > X-Priority: 3 (Normal) > Importance: Normal > > sea...@example.com > ======================= > > There are other headers too and they are bit different than this one so can > it be generalized. > > Thank you > Pratap > >