Subject: Re: [sup-talk] printing emails (but not attachments)

From: John Bent <[email-masked]>
Date: Wed, 17 Mar 2010 13:25:02 -0600

Excerpts from John Bent's message of Thu Mar 11 14:11:21 -0700 2010:
> I've been piping emails into muttprint which works well unless there's
> a binary attachment.  When there's a binary attachment, muttprint
> prints it and it usually takes tens and tens of pages.  Whoops.
> 
> Anyone else figure out how to print emails but not attachments?
> 
Well, I'm sure I've once again reinvented the wheel but I wrote my own
script to print emails without printing binary attachments.  It reads an
email, pipes the headers to muttprint, then pipes text/plain and
text/html through w3m into muttprint, for everything else it pipes "#
Attachment: filename (type)."  It requires w3m and muttprint to be in
the user's path.

I'm sorry that it's horribly in violation of sup philosophy but I wrote
it in python. :(  Sorry but my ruby is just barely good enough to do
'if' statements in my hooks.

It's attached in case anyone else wants it.  I'm scared I really did
just reinvent the wheel, otherwise I'd add it to the wiki.  To print an
email from sup using this, hit '|' in thread-view-mode to open a pipe
and then just type sup-print (assuming you've put this attachment in
your path).  I believe all the python imports it uses come standard.
-- 
Thanks,

John 
_______________________________________________
sup-talk mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-talk

---

From: Michael McDermott <[email-masked]>
Date: Wed, 17 Mar 2010 14:47:16 -0500

Well, I'm not a dev, but this little wrapper + muttprint is exactly the
kind of thing I've been looking for, from the time I was using pine
until now.

Thanks for posting it.

-- 
Michael McDermott
www.mad-computer-scientist.com
_______________________________________________
sup-talk mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-talk

---

From: John Bent <[email-masked]>
Date: Wed, 17 Mar 2010 18:28:04 -0600

> kind of thing I've been looking for, from the time I was using pine
Glad you like it.  Added it to the wiki.  Although it seems to make much
more sense to have this functionality inside sup itself.  sup already
knows how to decode and display many of the content-types, it already
hides attachments it can't display, and it formats the headers as well.
I tried writing a patch to add a config line for printer command,
add a keystroke for printing, and then have sup pipe the modified email
into the defined printer command, but it's beyond my ruby skills and
beyond the time I spent trying to grok sup.

John
-- 
Thanks,

John

---

From: John Bent <[email-masked]>
Date: Thu, 11 Mar 2010 14:11:21 -0700

I've been piping emails into muttprint which works well unless there's a
binary attachment.  When there's a binary attachment, muttprint prints
it and it usually takes tens and tens of pages.  Whoops.

Thanks,

John

---

From: John Bent <[email-masked]>
Date: Wed, 17 Mar 2010 14:31:31 -0600

> your path).  I believe all the python imports it uses come standard.
Sorry, it wasn't handling quoted-printable encodings.  Patched version
attached.
-- 
Thanks,

John