Mike Mondragon
2008-Nov-11 02:23 UTC
[Tmail-talk] problems with gem installing Tmail with Ruby 1.9.1-preview on Linux
I''m having problems installing Tmail using the Ruby 1.9.1-preview
release in a Linux Ubuntu Desktop
http://www.ruby-lang.org/en/news/2008/10/28/ruby-1-9-1-preview-1-released/
My problem is likely related to my installation environment so
hopefully someone else has overcome my experiences.
I compile Ruby with a ''19'' suffix (e.g. ./configure
--program-suffix=19 && make && sudo make install) and install to
/user/local , thus my ruby is named /usr/local/bin/ruby19
I then install RubyGems 1.3.1 by hand ''sudo ruby19 setup.rb''
which
installs a Ruby 1.9 based gem, gem19
I then install Tmail from the latest gem file ''sudo gem19 install
tmail-1.2.3.1.gem''
Below is the error I get, the obvious offender is
tmailscanner.c:19:16: error: re.h: No such file or directory
so I''m not sure why the 1.9.1 version of re.h is not being installed
when Ruby 1.9 is installed. And the actual 1.9.1 re.h RString struct
doesn''t have a member name ptr.
Thanks in advance for any help I can get with this.
sudo gem19 install tmail-1.2.3.1.gem
[sudo] password for mike:
Building native extensions. This could take a while...
ERROR: Error installing tmail-1.2.3.1.gem:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby19 extconf.rb install tmail-1.2.3.1.gem
creating Makefile
make
gcc -I. -I/usr/local/include/ruby19-1.9.1/i686-linux
-I/usr/local/include/ruby19-1.9.1/ruby/backward
-I/usr/local/include/ruby19-1.9.1 -I. -D_FILE_OFFSET_BITS=64 -fPIC
-O2 -g -Wall -Wno-parentheses -D_FILE_OFFSET_BITS=64 -o
tmailscanner.o -c tmailscanner.c
tmailscanner.c:19:16: error: re.h: No such file or directory
tmailscanner.c: In function ''mails_s_new'':
tmailscanner.c:75: error: ''struct RString'' has no member named
''ptr''
tmailscanner.c:77: error: ''struct RString'' has no member named
''len''
tmailscanner.c: In function ''skip_japanese_string'':
tmailscanner.c:188: warning: implicit declaration of function
''ismbchar''
tmailscanner.c:189: warning: implicit declaration of function
''mbclen''
tmailscanner.c: In function ''digit_p'':
tmailscanner.c:379: error: ''struct RString'' has no member
named ''ptr''
tmailscanner.c:380: error: ''struct RString'' has no member
named ''len''
tmailscanner.c:381: error: ''struct RString'' has no member
named ''ptr''
tmailscanner.c:381: error: ''struct RString'' has no member
named ''ptr''
tmailscanner.c: In function ''atomsym'':
tmailscanner.c:399: error: ''struct RString'' has no member
named ''ptr''
tmailscanner.c: In function ''debug_print'':
tmailscanner.c:420: error: ''struct RString'' has no member
named ''ptr''
tmailscanner.c:421: error: ''struct RString'' has no member
named ''ptr''
make: *** [tmailscanner.o] Error 1
Gem files will remain installed in
/usr/local/lib/ruby/gems/1.9.1/gems/tmail-1.2.3.1 for inspection.
Results logged to
/usr/local/lib/ruby/gems/1.9.1/gems/tmail-1.2.3.1/ext/tmailscanner/tmail/gem_make.out
--
Mike Mondragon
Work> http://sas.quat.ch/
Blog> http://blog.mondragon.cc/
Mikel Lindsaar
2008-Nov-12 02:18 UTC
[Tmail-talk] problems with gem installing Tmail with Ruby 1.9.1-preview on Linux
On Tue, Nov 11, 2008 at 1:23 PM, Mike Mondragon <mikemondragon at gmail.com>wrote:> I''m having problems installing Tmail using the Ruby 1.9.1-preview > release in a Linux Ubuntu Desktop > http://www.ruby-lang.org/en/news/2008/10/28/ruby-1-9-1-preview-1-released/ >Heya Mike, Haven''t come across that before. I''ve done some limited testing on TMail in 1.9.0 but on a Mac platform, built fine there, haven''t tried Linux. Due to the speed ups in Ruby 1.9 I am thinking of dropping the C Extensions all together for the 2.0 release of TMail (which is going to be written against 1.9 Ruby with the current TMail 1.x tree staying on 1.8.x Ruby) Anyway, let me know if you find a solution or need any other help. Mikel -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/tmail-talk/attachments/20081112/b3482efb/attachment.html>
Mike Mondragon
2008-Nov-12 07:38 UTC
[Tmail-talk] problems with gem installing Tmail with Ruby 1.9.1-preview on Linux
On Tue, Nov 11, 2008 at 6:18 PM, Mikel Lindsaar <raasdnil at gmail.com> wrote:> On Tue, Nov 11, 2008 at 1:23 PM, Mike Mondragon <mikemondragon at gmail.com> > wrote: >> >> I''m having problems installing Tmail using the Ruby 1.9.1-preview >> release in a Linux Ubuntu Desktop >> http://www.ruby-lang.org/en/news/2008/10/28/ruby-1-9-1-preview-1-released/ > > Heya Mike, > Haven''t come across that before. I''ve done some limited testing on TMail in > 1.9.0 but on a Mac platform, built fine there, haven''t tried Linux. > Due to the speed ups in Ruby 1.9 I am thinking of dropping the C Extensions > all together for the 2.0 release of TMail (which is going to be written > against 1.9 Ruby with the current TMail 1.x tree staying on 1.8.x Ruby) > Anyway, let me know if you find a solution or need any other help. > Mikel > > > > _______________________________________________ > Tmail-talk mailing list > Tmail-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/tmail-talk > >It also happens for me installing Hpricot (it has C bindings). So I''m likely noob''n my 1.9 environment somehow. Thanks Mike
Mikel Lindsaar
2008-Nov-12 08:50 UTC
[Tmail-talk] problems with gem installing Tmail with Ruby 1.9.1-preview on Linux
> > It also happens for me installing Hpricot (it has C bindings). So I''m > likely noob''n my 1.9 environment somehow. >sounds so. Mikel -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/tmail-talk/attachments/20081112/2c6000d9/attachment.html>
Hi, I receive emails like this: Email 1: Has a text/plain part and an image/gif part Email 2: Has a text/plain part and an image/gif attachment Email 3: Has a text/plain part and an image/gif part and an image/gif attachment This means that some files sent with the emails, appear both as a part and an attachment (case 3). I would like to support all three cases, but not read the same file twice (case 3 - as part AND attachment). My guess is, that I will need to compare file names: >> m.parts.last.header[''content-type''].params[''name''] => "ATT84490317.gif" >> m.attachments.last.original_filename => "ATT84490317.gif" But in this approach, the m.parts.last.header[''content- type''].params[''name''] section is not very robust (the content-type header could be cased like Content-Type for example). Is there a better way? Thanks, Morten
Peter Burkholder
2008-Nov-13 20:45 UTC
[Tmail-talk] Dealing with duplicate attachments/parts
On Nov 13, 2008, at 8:11 AM, Morten wrote:> This means that some files sent with the emails, appear both as a > part and an attachment (case 3). I would like to support all three > cases, but not read the same file twice (case 3 - as part AND > attachment). My guess is, that I will need to compare file names:What mailers have you seen do this?> > >> m.parts.last.header[''content-type''].params[''name''] > => "ATT84490317.gif" > >> m.attachments.last.original_filename > => "ATT84490317.gif" > > But in this approach, the m.parts.last.header[''content-type''].params > [''name''] section is not very robust (the content-type header could > be cased like Content-Type for example). Is there a better way?IIRC, the header hashes are case-insensitive. -Peter -- Peter Burkholder [Contractor] +1-301-402-7499 burkholp at ncbi.nlm.nih.gov Applications Administrator, NCBI/NLM/NIH -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/tmail-talk/attachments/20081113/7a71f796/attachment.html>
On Nov 13, 2008, at 9:45 PM, Peter Burkholder wrote:> > On Nov 13, 2008, at 8:11 AM, Morten wrote: > >> This means that some files sent with the emails, appear both as a >> part and an attachment (case 3). I would like to support all three >> cases, but not read the same file twice (case 3 - as part AND >> attachment). My guess is, that I will need to compare file names: > > What mailers have you seen do this?Lotus Notes 2004 (I know...)> >> >> m.parts.last.header[''content-type''].params[''name''] >> => "ATT84490317.gif" >> >> m.attachments.last.original_filename >> => "ATT84490317.gif" >> >> But in this approach, the m.parts.last.header[''content- >> type''].params[''name''] section is not very robust (the content-type >> header could be cased like Content-Type for example). Is there a >> better way? > > IIRC, the header hashes are case-insensitive.It wasn''t for the above, an also, the above approach just seems rickety in general, perhaps there''s no "name" params in the content- type header, perhaps there''s no disposition with the info either. I take it that sending "non text" as a part is considered bad behavior by most mail clients (we''ve processed hundreds of thousands of emails and not seen this before now). Br, Morten
Mikel Lindsaar
2008-Nov-14 02:21 UTC
[Tmail-talk] Dealing with duplicate attachments/parts
On Fri, Nov 14, 2008 at 8:05 AM, Morten <lists at kikobu.com> wrote:> On Nov 13, 2008, at 9:45 PM, Peter Burkholder wrote: > >> On Nov 13, 2008, at 8:11 AM, Morten wrote: >> >>> This means that some files sent with the emails, appear both as a part >>> and an attachment (case 3). I would like to support all three cases, but not >>> read the same file twice (case 3 - as part AND attachment). My guess is, >>> that I will need to compare file names: >>> >> What mailers have you seen do this? >> > Lotus Notes 2004 (I know...)Ouch>> m.parts.last.header[''content-type''].params[''name''] >>> => "ATT84490317.gif" >>> >> m.attachments.last.original_filename >>> => "ATT84490317.gif" >>> >>> But in this approach, the >>> m.parts.last.header[''content-type''].params[''name''] section is not very >>> robust (the content-type header could be cased like Content-Type for >>> example). Is there a better way? >>> >> >> IIRC, the header hashes are case-insensitive. > >This is correct, TMail downcases everything in the main and sub types (look at the ContentTypeHeader class in header.rb (around line 750)> It wasn''t for the above, an also, the above approach just seems rickety in > general, perhaps there''s no "name" params in the content-type header, > perhaps there''s no disposition with the info either. I take it that sending > "non text" as a part is considered bad behavior by most mail clients (we''ve > processed hundreds of thousands of emails and not seen this before now). >TMail is pretty good at handling attachments and edge cases. There are a bunch of tests in test_mail for this, but all the new edge case attachment problems I am putting in test_attachments.rb. If you can find a test case which should work but doesn''t, please let me know. Mikel -- http://lindsaar.net/ Rails, RSpec and Life blog.... -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/tmail-talk/attachments/20081114/657196e7/attachment.html>
Hi, thanks for the feedback on this, much appreciated. Here''s a sample of a Lotus Notes mail which uses a part instead of attachments: http://pastie.org/private/uum5zriyhysnhe851xia Here''s a sample of a mail which has both parts and attachments (not Lotus notes, I confused the two, looks like some MS Exchange/OLE stuff): http://pastie.org/private/omofwgmi94dhxv4eigirg For the latter, the attachments appear both as parts and attachments, not sure if this is a TMail issue (they''re only in there once) >> m.attachments.size => 3 >> m.parts.size => 4 And also, the generic headers hash is not case insensitive it seems: >> m.parts.last.header[''content-type''] => #<TMail::ContentTypeHeader "image/gif;\r\n name=\"ATT84490317.gif\""> >> m.parts.last.header[''Content-Type''] => nil If I use m.parts.last.content_type I get the content type fine, but I need the raw header to access the name attribute. For now, my work around is to scan for parts of specific content types (pdf, jpg, gif etc.) and check that the mail does not also have attachments. I will try and dig into the test cases for header case sensitivity, but could use some direction in the parts/attachment issue. This is TMail 1.2.3 BTW. Br, Morten On Nov 14, 2008, at 3:21 AM, Mikel Lindsaar wrote:> On Fri, Nov 14, 2008 at 8:05 AM, Morten <lists at kikobu.com> wrote: > On Nov 13, 2008, at 9:45 PM, Peter Burkholder wrote: > On Nov 13, 2008, at 8:11 AM, Morten wrote: > This means that some files sent with the emails, appear both as a > part and an attachment (case 3). I would like to support all three > cases, but not read the same file twice (case 3 - as part AND > attachment). My guess is, that I will need to compare file names: > What mailers have you seen do this? > Lotus Notes 2004 (I know...) > > Ouch > > >> m.parts.last.header[''content-type''].params[''name''] > => "ATT84490317.gif" > >> m.attachments.last.original_filename > => "ATT84490317.gif" > > But in this approach, the m.parts.last.header[''content- > type''].params[''name''] section is not very robust (the content-type > header could be cased like Content-Type for example). Is there a > better way? > > IIRC, the header hashes are case-insensitive. > > > This is correct, TMail downcases everything in the main and sub > types (look at the ContentTypeHeader class in header.rb (around line > 750) > > It wasn''t for the above, an also, the above approach just seems > rickety in general, perhaps there''s no "name" params in the content- > type header, perhaps there''s no disposition with the info either. I > take it that sending "non text" as a part is considered bad behavior > by most mail clients (we''ve processed hundreds of thousands of > emails and not seen this before now). > > TMail is pretty good at handling attachments and edge cases. > > There are a bunch of tests in test_mail for this, but all the new > edge case attachment problems I am putting in test_attachments.rb. > If you can find a test case which should work but doesn''t, please > let me know. > > Mikel > > > -- > http://lindsaar.net/ > Rails, RSpec and Life blog.... > > > _______________________________________________ > Tmail-talk mailing list > Tmail-talk at rubyforge.org > http://rubyforge.org/mailman/listinfo/tmail-talk