I got the problem fixed by using Mail::Header perl module and it is better
than before. Thanks for all your inputs , really appreciated.
Rregards,
Pratap
> "SPS" == S Pratap Singh writes:
SPS> There are other headers too and they are bit different than this
SPS> one so can it be generalized.
use a module. there are several which parse email headers. doing it
yourself and with a regex is very difficult.
uri
--
Uri Guttman -- u...
And in case : could also be present as a part of data, you should probably
look for regex as a delimiter for the split operation.
Cheers,
Parag
On Tue, Oct 12, 2010 at 10:05 AM, Parag Kalra wrote:
> Ok.
>
> I think simpler option here would be:
>
> 1. Assign the email header string to a varia
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
Here it is
Return-path:
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 )
id 1OkRhm-000
Could you please post an actual example of your email header.
Cheers,
Parag
On Tue, Oct 12, 2010 at 9:20 AM, S Pratap Singh wrote:
> Hello ,
>
> I am trying to write a script which can parse email header and based on
> certain criteria/parameter it will update the email subject detail in the