Andrew Bennetts wrote:
>
> On Thu, Apr 05, 2001 at 12:21:05PM +1000, Sonam Chauhan wrote:
> > I get the feeling with all these mail manipulation programs out there,
> > there is likely to be one that understands a RFC 822 Date: header
> > and converts the date to a simpler data structure.
> > Q 1.) Can someone suggest such a program ?
>
> Perhaps formail(1)? I'm not really sure, but I *think* it could
> probably help with this... anyway, it's part of the procmail package on
> debian.
Thanks guys... I'm relatively new to procmail et al but it doesn't look like
it has what I want.
>
> Otherwise, Python has a rfc822 module :)
>
Bingo! It just what I need.
--SNIP--
parsedate (date)
Attempts to parse a date according to the rules in RFC 822 . however, some
mailers don't follow that format as
specified, so parsedate() tries to guess correctly
in such cases. date is a string containing an RFC 822 date, such as 'Mon, 20
Nov 1995 19:12:08 -0500'. If it
succeeds in parsing the date, parsedate()
returns a 9-tuple that can be passed directly to time.mktime(); otherwise None
will be returned. Note that fields
6, 7, and 8 of the result tuple are not usable.
--SNIP--
I've heard good things about Python so I'll give it a try.Is it easy to learn?
Regards,
Sonam
--
Electronic Commerce
Corporate Express Australia Ltd.
Phone: +61-2-9335-0725 Fax: +61-2-9335-0753
--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug