From zeljko.filipin at gmail.com Mon Dec 8 05:06:15 2008 From: zeljko.filipin at gmail.com (=?UTF-8?Q?=C5=BDeljko_Filipin?=) Date: Mon, 8 Dec 2008 11:06:15 +0100 Subject: [Tmail-talk] received header In-Reply-To: References: Message-ID: Adding some more information: OS: Microsoft Windows Server 2003 R2, Standard Edition, Service Pack 2 ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32] tmail (1.2.3.1) On Wed, Nov 26, 2008 at 14:43, ?eljko Filipin wrote: > Hi, > > I am inspecting all headers of a mail (it is attached as mail.eml): > > > irb(main):001:0> require 'tmail' > => true > irb(main):002:0> mail = TMail::Mail.load "mail.eml" > => # Settings/Administrator/Desktop/mail.eml> bodyport=nil> > ... > irb(main):021:0> mail.each_header { |header, value| puts "#{header} = > #{value}" } > x-originalarrivaltime = 26 Nov 2008 12:32:26.0649 (UTC) > FILETIME=[0A483090:01C94FC3] > message-id = > reply-to = community title > thread-topic = [community_url] discussion title > mime-version = 1.0 > x-ecs-notification = yes > date = Wed, 26 Nov 2008 13:32:26 +0100 > content-type = multipart/alternative; > boundary=mimepart_492d4dfccc588_4e414263a42dd > from = Member-1 ECS > priority = normal > thread-index = AclPwwpFsbP3/gTxQnW3+VbCjC3GxQ== > x-receiver = Leader-1.ECS at 1.users.local > subject = [community_url] discussion title > to = community title > received = > content-class = urn:content-classes:message > x-mimeole = Produced By Microsoft MimeOLE V6.00.3790.4325 > importance = normal > list-id = "community title" > x-sender = > bc3c4c3b-a0b3-47fc-a490-cfae3b0c8eb0=community_url=Leader-1.ECS=1.users.local at 1.ecs.local > ... > > > Please notice that header "received" has empty value. It is not empty in > mail: > > > Received: from mail pickup service by win2003-mac-3-trunk with Microsoft > SMTPSVC; > Wed, 26 Nov 2008 13:32:26 +0100 > > If I do value.inspect it is not empty: > > > irb(main):024:0> mail.each_header { |header, value| puts "#{header} = > #{value.inspect}" } > ... > to = # >\n"> > received = # win2003-mac-3-trunk with Microsoft SMTPSVC;\n Wed, 26 Nov 2008 13:32:26 > +0100"> > content-class = # > ... > > > For some reason to_s returns empty string for "received" header: > > irb(main):025:0> mail["received"] > => [# win2003-mac-3-trunk with Microsoft SMTPSVC;\n Wed, 26 Nov 2008 13:32:26 > +0100">] > irb(main):026:0> mail["received"].to_s > => "" > > > but to_s does not return emtpy string for other headers: > > > irb(main):031:0> mail["content-type"] > => # boundary=\"----=_NextPart_000_0066_01C94FCB.6C0A4EA0\""> > irb(main):033:0> mail["content-type"].to_s > => "multipart/alternative; boundary=mimepart_492d4dfccc588_4e414263a42dd" > > > Anybody has an idea what went wrong? > > Thanks, > > ?eljko Filipin > -- > http://zeljkofilipin.com/ > http://watirpodcast.com/ > -------------- next part -------------- An HTML attachment was scrubbed... URL: From sam at three60.com Tue Dec 30 10:59:02 2008 From: sam at three60.com (Sam Luther) Date: Tue, 30 Dec 2008 10:59:02 -0500 Subject: [Tmail-talk] writing out or extracting attachments? Message-ID: <3F8EDE64-1F55-48D3-AEF2-67E2C382F743@three60.com> Hello, @email = TMail::Mail.load('/Users/sam/Desktop/test.eml') @email.attachments.each do |f| # how do i write out the attachment or move it? I tried this, # FileUtils.mv f, "/Users/sam/Desktop/processed/ #{f.original_filename}" end thanks in advance for any help.