Skip to content

Instantly share code, notes, and snippets.

@imbriaco
Created November 7, 2008 05:28
Show Gist options
  • Save imbriaco/22786 to your computer and use it in GitHub Desktop.
Save imbriaco/22786 to your computer and use it in GitHub Desktop.
1. Save test.rb and danish_email to a directory somewhere.
2. Copy rails/actionmailer/lib/action_mailer/vendor/tmail-1.2.3 to the directory.
3. Run test.rb under JRuby. Generates an exception like this:
% jruby test.rb
org.jruby.util.Pack:903:in `unpack': java.lang.ArrayIndexOutOfBoundsException: -61
from org.jruby.RubyString:3443:in `unpack'
from org.jruby.RubyString$i_method_1_0$RUBYINVOKER$unpack:-1:in `call'
from org.jruby.runtime.callsite.CachingCallSite:280:in `cacheAndCall'
from org.jruby.runtime.callsite.CachingCallSite:116:in `call'
from org.jruby.ast.CallOneArgNode:57:in `interpret'
from org.jruby.ast.CallNoArgNode:61:in `interpret'
from org.jruby.ast.NewlineNode:101:in `interpret'
from org.jruby.internal.runtime.methods.DefaultMethod:165:in `interpretedCall'
from org.jruby.internal.runtime.methods.DefaultMethod:142:in `call'
from org.jruby.internal.runtime.methods.DefaultMethod:297:in `call'
from org.jruby.internal.runtime.methods.WrapperMethod:62:in `call'
from org.jruby.runtime.callsite.CachingCallSite:300:in `cacheAndCall'
from org.jruby.runtime.callsite.CachingCallSite:157:in `call'
from org.jruby.ast.CallTwoArgNode:59:in `interpret'
from org.jruby.ast.NewlineNode:101:in `interpret'
from org.jruby.internal.runtime.methods.DefaultMethod:165:in `interpretedCall'
from org.jruby.internal.runtime.methods.DefaultMethod:142:in `call'
from org.jruby.internal.runtime.methods.DefaultMethod:213:in `call'
from org.jruby.runtime.callsite.CachingCallSite:260:in `cacheAndCall'
from org.jruby.runtime.callsite.CachingCallSite:75:in `call'
from test:7:in `__file__'
from test:-1:in `__file__'
from test:-1:in `load'
from org.jruby.Ruby:560:in `runScript'
from org.jruby.Ruby:463:in `runNormally'
from org.jruby.Ruby:337:in `runFromMain'
from org.jruby.Main:214:in `run'
from org.jruby.Main:100:in `run'
from org.jruby.Main:84:in `main'
From david@loudthinking.com Thu Mar 17 11:04:02 2005
Return-Path: <david@loudthinking.com>
Delivered-To: honey@burnham.37signals.com
Received: from pfepc.post.tele.dk (pfepc.post.tele.dk [195.41.46.237])
by burnham.37signals.com (Postfix) with ESMTP id BE099149427
for <stephen26rachel@singlefile.com>; Thu, 17 Mar 2005 11:04:01 -0600 (CST)
Received: from [10.0.1.3] (0x5358c986.bynxx18.adsl-dhcp.tele.dk [83.88.201.134])
by pfepc.post.tele.dk (Postfix) with ESMTP id E00D126287B
for <stephen26rachel@singlefile.com>; Thu, 17 Mar 2005 18:03:47 +0100 (CET)
Mime-Version: 1.0 (Apple Message framework v619.2)
Content-Transfer-Encoding: quoted-printable
Message-Id: <292ceb0c2127ee338dd9e216958eccbb@loudthinking.com>
Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed
To: stephen26rachel@singlefile.com
From: David Heinemeier Hansson <david@loudthinking.com>
Subject: =?ISO-8859-1?Q?[166417]_Bekr=E6ftelse_fra_Rejsefeber?=
Date: Thu, 17 Mar 2005 18:03:47 +0100
X-Mailer: Apple Mail (2.619.2)
Her f=F8lger bekr=E6ftelse og betalingsvilk=E5r for rejsen.
$:.unshift(File.dirname(__FILE__) + "/tmail-1.2.3")
require "tmail"
message = IO.read(File.dirname(__FILE__) + "/danish_email")
mail = TMail::Mail.parse(message)
mail.base64_decode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment