Subject: [sup-talk] Case-sensitivity of Content-Type: more RubyMail stupidity?

From: [email-masked] (Kevin Riggle)
Date: Sat, 12 Sep 2009 15:10:03 -0400

Several people from whom I receive e-mail regularly use a MUA which 
generates Content-Type: headers of the form
> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed

The symptoms I see are that I don't get any preview text, and Sup shows
the message as consisting only of a spurious attachment of the form: 
> - Attachment: sup-attachment-1252774311-2202. (8 lines) 
(Note no file-type suffix.)

RFC 2045 (the MIME specification) section 5.1 says in part
> The type, subtype, and parameter names are not case sensitive.  For
> example, TEXT, Text, and TeXt are all equivalent top-level media
> types.
So the above should be handled just like the many mails with headers of
the form
> Content-Type: text/plain; charset="us-ascii"; format=flowed
I get, which Sup handles perfectly.

I theorize that RubyMail is being case-sensitive where it shouldn't.

Given the number of work-arounds Sup has had to implement to compensate
for RubyMail's stupidity, and that RubyMail is currently unmaintained,
has any thought been given to switching Sup to eg. TMail 
(http://tmail.rubyforge.org), which is maintained?

Failing that, thoughts on how best to work around this problem in Sup?

- Kevin
-- 
Kevin Riggle (kevinr at free-dissociation.com) 
http://free-dissociation.com

---

From: [email-masked] (William Morgan)
Date: Sat, 26 Sep 2009 11:17:14 -0700

> I theorize that RubyMail is being case-sensitive where it shouldn't.

Although I love criticizing RubyMail, I think this is Sup's fault. I
don't think it's in RubyMail's proper purview to canonicalize header
values (though header names are fine).

Anyways, I think I've fixed this in git. Give it a try.

> Given the number of work-arounds Sup has had to implement to
> compensate for RubyMail's stupidity, and that RubyMail is currently
> unmaintained, has any thought been given to switching Sup to eg. TMail

It's certainly an option, but with so many workarounds invested in
RubyMail, I'm not sure it's a win. A patch that magically makes
everything work would certainly be considered.
-- 
William <wmorgan-sup at masanjin.net>

---

From: [email-masked] (Kevin Riggle)
Date: Sat, 26 Sep 2009 17:35:31 -0400

> Anyways, I think I've fixed this in git. Give it a try.
Updated to next, restarted Sup, went to open a message, and got this crash:
(Appears to be individual messages, not all messages.)

--- NoMethodError from thread: load messages for thread-view-mode
undefined method `downcase' for nil:NilClass
./lib/sup/message.rb:439:in `message_to_chunks'
./lib/sup/message.rb:239:in `load_from_source!'
./lib/sup/modes/thread-index-mode.rb:108:in `select'
./lib/sup/hook.rb:121:in `each_with_index'
./lib/sup/thread.rb:68:in `each'
./lib/sup/thread.rb:168:in `each_with_stuff'
./lib/sup/thread.rb:67:in `each'
./lib/sup/modes/thread-index-mode.rb:105:in `each_with_index'
./lib/sup/modes/thread-index-mode.rb:105:in `select'
./lib/sup/buffer.rb:716:in `say'
./lib/sup/util.rb:520:in `send'
./lib/sup/util.rb:520:in `method_missing'
./lib/sup/modes/thread-index-mode.rb:104:in `select'
./lib/sup.rb:77:in `reporting_thread'
./lib/sup.rb:75:in `initialize'
./lib/sup.rb:75:in `new'
./lib/sup.rb:75:in `reporting_thread'
./lib/sup/modes/thread-index-mode.rb:101:in `select'
./lib/sup/mode.rb:51:in `send'
./lib/sup/mode.rb:51:in `handle_input'
./lib/sup/buffer.rb:267:in `handle_input'
bin/sup:238

- Kevin

---

From: [email-masked] (William Morgan)
Date: Sat, 26 Sep 2009 18:46:03 -0700

> undefined method `downcase' for nil:NilClass

Should be fix0red.

---

From: [email-masked] (Kevin Riggle)
Date: Sun, 27 Sep 2009 03:10:51 -0400

> > undefined method `downcase' for nil:NilClass

Looks like it is -- thanks!

- Kevin