Subject: [sup-talk] new in svn: mime-type hook

From: [email-masked] (William Morgan)
Date: Tue, 28 Aug 2007 21:15:23 -0700

There's a new hook for all your MIME decoding needs:

  mime-decode
  -----------
  File: ~/.sup/hooks/mime-decode.rb
  Executes when decoding a MIME attachment.
  Variables:
     content_type: the content-type of the message
         filename: the filename of the attachment as saved to disk (generated
                   on the fly, so don't call more than once)
    sibling_types: if this attachment is part of a multipart MIME attachment,
                   an array of content-types for all attachments. Otherwise,
                   the empty array.
  Return value:
    The decoded text of the attachment, or nil if not decoded.

Here's what I use for mime-decode.rb. It uses w3m to translate all HTML
attachments that don't have a text/html alternative:

  unless sibling_types.member? "text/plain"
    case content_type
    when "text/html"
      `/usr/bin/w3m -dump -T #{content_type} '#{filename}'`
    end
  end

-- 
William <wmorgan-sup at masanjin.net>

---

From: [email-masked] (jeff covey)
Date: Fri, 31 Aug 2007 15:02:44 -0400

>   File: ~/.sup/hooks/mime-decode.rb

it's working for me, thanks!  a lot of messages are finally showing
something other than a single "attachment" line.  :)

in the process of making this, did something go wrong with sup's decoding of
ordinary messages?  i'm seeing a lot of messages with equals marks at the
ends of lines, like:

> This e-mail notifies you that the Bureau of the Public Debt just issued=
>  a press
> release concerning the securities identified in the subject area of thi=
> s
> message. =A0Clicking on the address listed above after "Press Release" =
> should take
> you to Public Debt's Internet page of a PDF version of the actual press=

here's a copy of the original message from which this was taken:

http://jeffcovey.net/tmp/.sup-equals.txt

this was happening before and after i created my ~/.sup/hooks/mime-decode.rb
file.

thanks,

-- 
jeff covey
http://jeffcovey.net/

---

From: [email-masked] (Magnus Therning)
Date: Fri, 31 Aug 2007 20:36:14 +0100

On Fri, Aug 31, 2007 at 15:02:44 -0400, jeff covey wrote:
[..]
>
>in the process of making this, did something go wrong with sup's
>decoding of ordinary messages?  i'm seeing a lot of messages with
>equals marks at the ends of lines, like:
>
>this was happening before and after i created my
>~/.sup/hooks/mime-decode.rb file.

That looks like something relating to quoted-printable.  IIRC the equal
sign is an escape for the newline character.

/M

-- 
Magnus Therning                             (OpenPGP: 0xAB4DFBA4)
magnus?therning?org             Jabber: magnus?therning?gmail?com
http://therning.org/magnus

For a successful technology, reality must take precedence over public
relations, for nature cannot be fooled.
     -- R.P. Feynman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://rubyforge.org/pipermail/sup-talk/attachments/20070831/c6b50649/attachment.bin

---

From: [email-masked] (William Morgan)
Date: Fri, 31 Aug 2007 23:28:55 -0700

> equals marks at the ends of lines, like:

Whoops, yes. SVN up and see if that fixes it.

-- 
_____________________________________________________________________________
|                                                                           |
|        |                          \ | /                          |        |
|        |\                          \|/                          /|        |
|  |XXXXX||>>>>>>>>>>>>>>>>>>>>>>>  ((*))  <<<<<<<<<<<<<<<<<<<<<<<||XXXXX|  |
|        |/                          /|\                          \|        |
|        |                          / | \                          |        |
|                                                                           |
| Death Star                                                                |
| War Lord of the Sup                              wmorgan-sup at masanjin.net |
|___________________________________________________________________________|

---

From: [email-masked] (jeff covey)
Date: Sun, 02 Sep 2007 07:31:45 -0400

Excerpts from William Morgan's message of Sat Sep 01 02:28:55 -0400 2007:

> > decoding of ordinary messages?  i'm seeing a lot of messages with equals
> > marks at the ends of lines
> 

yes, seems to be fine now.

thanks,

-- 
jeff covey
http://jeffcovey.net/