From: Martin Pirker Date: 2003-04-02T07:48:37+09:00 Subject: parsing/decoding mail/news headers Hi... Just trying to put my Ruby skills to useful work - automatic handling, sorting, indexing of mail/news archives. Question 1: In RMail in found header/address parsing functions (nice stuff!), but I still havn't figured out how to decode the header parts which have been encoded for 7-bit(?) compatibility, e.g. given Subject: =?ISO-8859-1?Q?Erg=E4nzung?= should decode to Subject: Erg�nzung (that's a german word) I guess this has something to do with quoted-printable or MIME - are there some lib functions which do this or how do you do it? Question 2: I stumbled upon: irb(main):001:0> require "time" => true irb(main):002:0> Time.parse ("01 Apr 2003 23:38:05 +0200") => Tue Apr 01 23:38:05 CEST 2003 irb(main):003:0> Time.parse ("01 Apr 2033 23:38:05 +0200") => Fri Apr 01 23:38:05 CEST 2033 irb(main):004:0> Time.parse ("01 Apr 2043 23:38:05 +0200") ArgumentError: gmtime error from /usr/local/lib/ruby/1.8/time.rb:162:in 'utc' from /usr/local/lib/ruby/1.8/time.rb:162:in 'parse' from (irb):4 Large dates are not supported - I guess this has to do with the unix 32bit seconds time thing - unfortunately some spam has pretty crap in header... Catching the exception and ignoring that piece of mail/news is current option, any better? ruby -version ruby 1.8.0 (2003-03-03) [i686-linux] thanks for some hints, Martin