Subject: Re: [sup-talk] [PATCH] change opening attachements on darwin to use open instead of run-mailcap

From: Jon Dugan <[email-masked]>
Date: Fri, 30 Oct 2009 18:13:39 -0500

Excerpts from Jonah's message of Wed Oct 28 17:06:43 -0500 2009:
> I still haven't gotten sup to send mail yet,.. so more patches for MacOSX will
> probably be forthcoming.  :)

I use msmtp via MacPorts to send mail from OS X.  The sup wiki has some
information on how to use msmtp in the "how mail leaves" section:

http://sup.rubyforge.org/wiki/wiki.pl

And the MacPorts homepage is at:

http://macports.org/

Jon
-- 
Jon M. Dugan <[email-masked]>
ESnet Network Engineering Group
Lawrence Berkeley National Laboratory
_______________________________________________
sup-talk mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-talk

---

From: William Morgan <[email-masked]>
Date: Fri, 30 Oct 2009 15:07:19 -0700

Reformatted excerpts from Jonah's message of 2009-10-28:
> I've been working on getting sup to work in MacOSX (darwin).  MacOSX has a
> special command (open) for opening files - there is no support for mailcap. 
> This patch uses case to run the appropriate command depending on the
> architecture used.

Branch no-mailcap-on-darwin, merged into next. Thanks!

> I still haven't gotten sup to send mail yet,.. so more patches for
> MacOSX will probably be forthcoming.  :)

Great, glad to have them.
-- 
William <[email-masked]>
_______________________________________________
sup-talk mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-talk

---

From: Jonah <[email-masked]>
Date: Wed, 28 Oct 2009 18:06:43 -0400

Hey everyone,

I've been working on getting sup to work in MacOSX (darwin).  MacOSX has a special command (open) for opening files - there is no support for mailcap.  This patch uses case to run the appropriate command depending on the architecture used.

I still haven't gotten sup to send mail yet,.. so more patches for MacOSX will probably be forthcoming.  :)

I'm loving sup so far, keep up the great work!

Cheers,

Jonah

---
 lib/sup/message-chunks.rb |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/lib/sup/message-chunks.rb b/lib/sup/message-chunks.rb
index edc40c4..581b707 100644
--- a/lib/sup/message-chunks.rb
+++ b/lib/sup/message-chunks.rb
@@ -132,7 +132,12 @@ EOS
     def initial_state; :open end
     def viewable?; @lines.nil? end
     def view_default! path
-      cmd = "/usr/bin/run-mailcap --action=view '#{@content_type}:#{path}'"
+      case Config::CONFIG['arch']
+        when /darwin/
+          cmd = "open '#{path}'"
+        else
+          cmd = "/usr/bin/run-mailcap --action=view '#{@content_type}:#{path}'"
+      end
       debug "running: #{cmd.inspect}"
       BufferManager.shell_out(cmd)
       $? == 0
-- 
1.6.3.3
_______________________________________________
sup-talk mailing list
[email-masked]
http://rubyforge.org/mailman/listinfo/sup-talk