]> git.cworth.org Git - sup/commitdiff
Merge commit 'bwalton/bw/flexible_sent'
authorWilliam Morgan <wmorgan-sup@masanjin.net>
Wed, 24 Jun 2009 13:38:19 +0000 (09:38 -0400)
committerWilliam Morgan <wmorgan-sup@masanjin.net>
Wed, 24 Jun 2009 13:38:19 +0000 (09:38 -0400)
Conflicts:

lib/sup/poll.rb
lib/sup/sent.rb

27 files changed:
.gitignore
CONTRIBUTORS
History.txt
README.txt
Rakefile
ReleaseNotes
bin/sup
bin/sup-recover-sources
doc/FAQ.txt
doc/NewUserGuide.txt
lib/sup.rb
lib/sup/buffer.rb
lib/sup/index.rb
lib/sup/keymap.rb
lib/sup/mbox.rb
lib/sup/message-chunks.rb
lib/sup/message.rb
lib/sup/modes/edit-message-mode.rb
lib/sup/modes/reply-mode.rb
lib/sup/modes/scroll-mode.rb
lib/sup/modes/thread-index-mode.rb
lib/sup/modes/thread-view-mode.rb
lib/sup/poll.rb
lib/sup/source.rb
lib/sup/util.rb
sup.gemspec [deleted file]
www/index.html

index b8d3bcd9db2d341bdbfd2ac740281e33f5efa77c..082016036f6d6be2ad5a79435e657c7f1fa24388 100644 (file)
@@ -3,3 +3,5 @@
 .ditz-config
 # i use emacs
 *~
+# i use rake package task
+pkg/
index 56f553fe333252beb2cc07a8646344838db72542..f75015304c5bcf0fc3e256c5aba070a519bb64c9 100644 (file)
@@ -1,17 +1,22 @@
-William Morgan <wmorgan-sup at the masanjin dot nets>
-Ismo Puustinen <ismo at the iki dot fis>
 Nicolas Pouillard <nicolas.pouillard at the gmail dot coms>
+Mike Stipicevic <stipim at the rpi dot edus>
 Marcus Williams <marcus-sup at the bar-coded dot nets>
 Lionel Ott <white.magic at the gmx dot des>
+Ingmar Vanhassel <ingmar at the exherbo dot orgs>
 Mark Alexander <marka at the pobox dot coms>
 Christopher Warrington <chrisw at the rice dot edus>
-Marc Hartstein <marc.hartstein at the alum.vassar dot edus>
+Richard Brown <rbrown at the exherbo dot orgs>
 Ben Walton <bwalton at the artsci.utoronto dot cas>
+Marc Hartstein <marc.hartstein at the alum.vassar dot edus>
 Grant Hollingworth <grant at the antiflux dot orgs>
 Steve Goldman <sgoldman at the tower-research dot coms>
 Decklin Foster <decklin at the red-bean dot coms>
+Ismo Puustinen <ismo at the iki dot fis>
 Jeff Balogh <its.jeff.balogh at the gmail dot coms>
+Alex Vandiver <alexmv at the mit dot edus>
 Giorgio Lando <patroclo7 at the gmail dot coms>
 Israel Herraiz <israel.herraiz at the gmail dot coms>
 Ian Taylor <ian at the lorf dot orgs>
+Stefan Lundström <lundst at the snabb.(none)>
 Rich Lane <rlane at the club.cc.cmu dot edus>
+Kirill Smelkov <kirr at the landau.phys.spbu dot rus>
index 2813c6448459e7e76938a63d043e6c8e509e6031..5cdd5a626320b9206f5335c7a7550ee6dc3d8061 100644 (file)
@@ -1,3 +1,27 @@
+== 0.8.1 / 2009-06-15
+* make multibyte display "work" for non-utf8 locales
+* fix reply-mode always selecting "Customized"
+* reduce email quote parsing worst-case behavior
+
+== 0.8 / 2009-06-05
+* Undo support on many operations. Yay!
+* Mbox splitting fixes. No more "From "-line problems.
+* Mail parsing speedups.
+* Many utf8 and widechar fixes. Display of crazy characters should be pretty
+  close.
+* Outgoing email with non-ASCII headers is now properly encoded.
+* Email addresses are no longer permanently attached to names. This was
+  causing problems with automated email systems that used different names
+  with the same address.
+* Curses background now retains the terminal default color. This also makes
+  Sup work better on transparent terminals.
+* Improve dynamic loading of setlocale for Cygwin and BSD systems.
+* Labels can now be removed from multiple tagged threads.
+* Applying operations to tagged threads is now invoked with '='.
+* Buffer list is betterified and is now invoked with ';'.
+* Zsh autocompletion support.
+* As always, many bugfixes and tweaks.
+
 == 0.7 / 2009-03-16
 * Ferret index corruption issues fixed (hopefully!)
 * Text entry now scrolls to the right on overflow, i.e. is actually usable
index 0437de9f0c91b87b300c99077a88d7df82162100..4204270a3091ef9510be29bf6886e04f7981a900 100644 (file)
@@ -13,22 +13,20 @@ Sup makes it easy to:
 - Handle massive amounts of email.
 
 - Mix email from different sources: mbox files (even across different
-  machines), Maildir directories, IMAP folders, POP accounts, and
-  GMail accounts.
+  machines), Maildir directories, IMAP folders, and GMail accounts.
 
-- Instantaneously search over your entire email collection. Search
-  over body text, or use a query language to combine search
-  predicates in any way.
+- Instantaneously search over your entire email collection. Search over
+  body text, or use a query language to combine search predicates in any
+  way.
 
 - Handle multiple accounts. Replying to email sent to a particular
-  account will use the correct SMTP server, signature, and from
-  address.
+  account will use the correct SMTP server, signature, and from address.
 
-- Add custom code to handle certain types of messages or to handle
-  certain types of text within messages.
+- Add custom code to customize Sup to whatever particular and bizarre
+  needs you may have.
 
-- Organize email with user-defined labels, automatically track
-  recent contacts, and much more!
+- Organize email with user-defined labels, automatically track recent
+  contacts, and much more!
 
 The goal of Sup is to become the email client of choice for nerds
 everywhere.
@@ -48,40 +46,41 @@ Features:
   message level. Entire threads are manipulated and viewed (with
   redundancies removed) at a time.
 
-- Labels instead of folders. Drop that tired old metaphor and you'll
-  see how much easier it is to organize email.
+- Labels instead of folders. Drop that tired old metaphor and you'll see
+  how much easier it is to organize email.
 
-- GMail-style thread management (but better!). Archive a thread, and
-  it will disappear from your inbox until someone replies. Kill a
-  thread, and it will never come back to your inbox (but will still
-  show up in searches.) Mark a thread as spam and you'll never again
-  see it unless explicitly searching for spam.
+- GMail-style thread management. Archive a thread, and it will disappear
+  from your inbox until someone replies. Kill a thread, and it will
+  never come back to your inbox (but will still show up in searches.)
+  Mark a thread as spam and you'll never again see it unless explicitly
+  searching for spam.
 
 - Console based interface. No mouse clicking required!
 
-- Programmability. It's in Ruby. The code is good. It's easy to
-  extend.
+- Programmability. It's in Ruby. The code is good. It has an extensive
+  hook system that makes it easy to extend and customize.
 
-- Multiple buffer support. Why be limited to viewing one thread at a
+- Multiple buffer support. Why be limited to viewing one thing at a
   time?
 
-- Tons of other little features, like automatic context-sensitive
-  help, multi-message operations, MIME attachment viewing, recent
-  contact list generation, etc.
+- Tons of other little features, like automatic context-sensitive help,
+  multi-message operations, MIME attachment viewing, recent contact list
+  generation, etc.
 
 Current limitations which will be fixed:
 
-- Support for mbox, remote mbox, and IMAP only at this point. No
-  support for POP, mh, or GMail mailstores.
+- Sup doesn't play nicely with other mail clients. If you alter a mail
+  source (read, move, delete, etc) with another client Sup will punish
+  you with a lengthy reindexing process.
 
-- No internationalization support. No wide characters, no subject
-  demangling. 
+- Support for mbox, Maildir, and IMAP only at this point. No support for
+  POP or mh.
 
-- Unix-centrism in MIME attachment handling and in sendmail
-  invocation.
+- IMAP support is very slow due mostly to Ruby's IMAP library.  You may
+  consider something like offlineimap to mirror your IMAP folders with
+  local Maildir ones.
 
-- Several obvious missing features, like filters / saved
-  searches, message annotations, etc.
+- Unix-centrism in MIME attachment handling and in sendmail invocation.
 
 == SYNOPSYS:
 
@@ -90,21 +89,23 @@ Current limitations which will be fixed:
 
   Note that Sup never changes the contents of any mailboxes; it only
   indexes in to them. So it shouldn't ever corrupt your mail. The flip
-  side is that if you change a mailbox (e.g. delete messages, or, in
-  the case of mbox files, read an unread message) then Sup will be
-  unable to load messages from that source and will ask you to run
-  sup-sync --changed.
+  side is that if you change a mailbox (e.g. delete messages, or, in the
+  case of mbox files, read an unread message) then Sup will be unable to
+  load messages from that source and will ask you to run sup-sync
+  --changed.
 
 == REQUIREMENTS:
 
-* ferret >= 0.10.13
-* ncurses
-* rmail
-* highline
-* net-ssh
-* trollop >= 1.7
-* lockfile
-* mime-types
+ - ferret >= 0.11.6
+ - ncurses >= 0.9.1
+ - rmail >= 0.17
+ - highline
+ - net-ssh
+ - trollop >= 1.12
+ - lockfile
+ - mime-types
+ - gettext
+ - fastthread
 
 == INSTALL:
 
index 3b1d9f4fa82953e74a5d8af946591f6468749003..67cd0d21df9ca2e6b1ed14e6a873cc1fdabf742b 100644 (file)
--- a/Rakefile
+++ b/Rakefile
@@ -29,12 +29,38 @@ task :upload_report do |t|
   sh "rsync -essh -cavz ditz wmorgan@rubyforge.org:/var/www/gforge-projects/sup/"
 end
 
-task :gem do |t|
-  sh "gem1.8 build sup.gemspec"
+$:.push "lib"
+require 'rubygems'
+require "sup-files"
+require "sup-version"
+require 'rake/gempackagetask.rb'
+
+spec = Gem::Specification.new do |s|
+  s.name = %q{sup}
+  s.version = SUP_VERSION
+  s.date = Time.now.to_s
+  s.authors = ["William Morgan"]
+  s.email = %q{wmorgan-sup@masanjin.net}
+  s.summary = %q{A console-based email client with the best features of GMail, mutt, and emacs. Features full text search, labels, tagged operations, multiple buffers, recent contacts, and more.}
+  s.homepage = %q{http://sup.rubyforge.org/}
+  s.description = %q{Sup is a console-based email client for people with a lot of email. It supports tagging, very fast full-text search, automatic contact-list management, and more. If you're the type of person who treats email as an extension of your long-term memory, Sup is for you.  Sup makes it easy to: - Handle massive amounts of email.  - Mix email from different sources: mbox files (even across different machines), Maildir directories, IMAP folders, POP accounts, and GMail accounts.  - Instantaneously search over your entire email collection. Search over body text, or use a query language to combine search predicates in any way.  - Handle multiple accounts. Replying to email sent to a particular account will use the correct SMTP server, signature, and from address.  - Add custom code to handle certain types of messages or to handle certain types of text within messages.  - Organize email with user-defined labels, automatically track recent contacts, and much more!  The goal of Sup is to become the email client of choice for nerds everywhere.}
+  s.files = SUP_FILES
+  s.executables = SUP_EXECUTABLES
+
+  s.add_dependency "ferret", ">= 0.11.6"
+  s.add_dependency "ncurses", ">= 0.9.1"
+  s.add_dependency "rmail", ">= 0.17"
+  s.add_dependency "highline"
+  s.add_dependency "net-ssh"
+  s.add_dependency "trollop", ">= 1.12"
+  s.add_dependency "lockfile"
+  s.add_dependency "mime-types", "~> 1"
+  s.add_dependency "gettext"
+  s.add_dependency "fastthread"
 end
 
-task :tarball do |t|
-  require "sup-files"
-  require "sup-version"
-  sh "tar cfvz sup-#{SUP_VERSION}.tgz #{SUP_FILES.join(' ')}"
+Rake::GemPackageTask.new(spec) do |pkg|
+    pkg.need_tar = true
 end
+
+task :tarball => ["pkg/sup-#{SUP_VERSION}.tgz"]
index a965fa0ec099b1ab7cfa3afa21ee5c64d97ad07a..1923a6ef6c8f08b5b2dfcebd9cd83e3c9df95bc1 100644 (file)
@@ -1,3 +1,14 @@
+Release 0.8.1:
+
+A bugfix release with fixes for quote parsing (bad behavior in certain long
+emails), multibyte display for non-utf8 locales, and reply-mode mode selection.
+
+Release 0.8:
+
+The big wins are undo support, mbox splitting fixes, and the various UI
+speedups and bugfixes. Parsing new email should also be faster, although
+IMAP remains tragically slow, as usual.
+
 Release 0.7:
 
 The big win in this release is that Ferret index corruption issues should now
diff --git a/bin/sup b/bin/sup
index 9abe1b54c395630857445d4268baacfcd1c5e930..302ad7c9764673f17fafb3b9948fe1624c80959a 100755 (executable)
--- a/bin/sup
+++ b/bin/sup
@@ -5,7 +5,6 @@ require 'ncurses'
 require 'curses'
 require 'fileutils'
 require 'trollop'
-require 'fastthread'
 require "sup"
 
 BIN_VERSION = "git"
@@ -89,7 +88,7 @@ end
 ## BSD users: if libc.so.6 is not found, try installing compat6x.
 require 'dl/import'
 module LibC
-  extend DL::Importable
+  extend DL.const_defined?(:Importer) ? DL::Importer : DL::Importable
   setlocale_lib = case Config::CONFIG['arch']
     when /darwin/; "libc.dylib"
     when /cygwin/; "cygwin1.dll"
@@ -202,7 +201,7 @@ begin
     end
   end unless $opts[:no_initial_poll]
   
-  imode.load_threads :num => ibuf.content_height, :when_done => lambda { reporting_thread("poll after loading inbox") { sleep 1; PollManager.poll } unless $opts[:no_threads] || $opts[:no_initial_poll] }
+  imode.load_threads :num => ibuf.content_height, :when_done => lambda { |num| reporting_thread("poll after loading inbox") { sleep 1; PollManager.poll } unless $opts[:no_threads] || $opts[:no_initial_poll] }
 
   if $opts[:compose]
     ComposeMode.spawn_nicely :to_default => $opts[:compose]
index af39b7df4ed466afa3907cc93128a83ef0eb08dc..d3b1424de0778bb6350bc4fd53dbbd3bff4602f9 100755 (executable)
@@ -72,18 +72,14 @@ ARGV.each do |fn|
   source_ids = {}
   count = 0
   source.each do |offset, labels|
-    begin
-      m = Redwood::Message.new :source => source, :source_info => offset
-      docid, entry = index.load_entry_for_id m.id
-      next unless entry
-      #puts "# #{source} #{offset} #{entry[:source_id]}"
-
-      source_ids[entry[:source_id]] = (source_ids[entry[:source_id]] || 0) + 1
-      count += 1
-      break if count == $opts[:scan_num]
-    rescue Redwood::MessageFormatError => e
-      puts "# #{e.message}"
-    end
+    m = Redwood::Message.new :source => source, :source_info => offset
+    docid, entry = index.load_entry_for_id m.id
+    next unless entry
+    #puts "# #{source} #{offset} #{entry[:source_id]}"
+
+    source_ids[entry[:source_id]] = (source_ids[entry[:source_id]] || 0) + 1
+    count += 1
+    break if count == $opts[:scan_num]
   end
 
   if source_ids.size == 1
index 5c85d9c55346f37221dd7ad47ccecf0f483d0946..997a35735b1be65f111150452ef055f7789df717 100644 (file)
@@ -2,21 +2,17 @@ Sup FAQ
 -------
 
 Q: What is Sup?
-A: Sup is a console-based email client for people with a lot of email.
-   It supports tagging, very fast full-text search, automatic contact-
-   list management, custom code insertion via a hook system, and more.
-   If you're the type of person who treats email as an extension of your
-   long-term memory, Sup is for you.
+A: A console-based email client for people with a lot of email.
 
 Q: What does Sup stand for?
 A: "What's up?"
 
 Q: Sup looks like a text-based Gmail.
-A: I stole their ideas. And improved them!
+A: First I stole their ideas. Then I improved them.
 
 Q: Why not just use Gmail?
-A: I wrote Sup because I hate ads, I hate using a mouse, and I hate
-   non-programmability and non-extensibility.
+A: I hate ads, I hate using a mouse, and I hate non-programmability and
+   non-extensibility.
 
    Also, Gmail doesn't let you use a monospace font, which is just
    lame.
@@ -30,8 +26,9 @@ A: Because a keystroke is worth a hundred mouse clicks, as any Unix
 
 Q: How does Sup deal with spam?
 A: You can manually mark messages as spam, which prevents them from
-   showing up in future searches, but that's as far as Sup goes. Spam
-   filtering should be done by a dedicated tool like SpamAssassin.
+   showing up in future searches. Later, you can run a batch process to
+   remove such messages from your sources. That's as far as Sup goes.
+   Spam filtering should be done by a dedicated tool like SpamAssassin.
 
 Q: How do I delete a message?
 A: Why delete? Unless it's spam, you might as well just archive it.
@@ -90,21 +87,13 @@ A: Move the messages from the source to the target using whatever tool
 
 Q: What are all these "Redwood" references I see in the code?
 A: That was Sup's original name. (Think pine, elm. Although I was a
-   Mutt user, I couldn't think of a good progression there.) But it
-   was taken by another project on RubyForge, and wasn't that
-   original, and was too long to type anyways.
-
-   Maybe one day I'll do a huge search-and-replace on the code, but it
-   doesn't seem that important at this point.
+   Mutt user, I couldn't think of a good progression there.) But it was
+   taken by another project on RubyForge, and wasn't that original, and
+   was too long to type anyways.
 
 Common Problems
 ---------------
 
-P: I see this message from Ferret:
-     Error occured in index.c:825 - sis_find_segments_file
-S: Yikes! You've upgraded Ferret and the index format changed beneath
-   you. Follow the index rebuild instructions above.
-
 P: I get some error message from Rubymail about frozen strings when
    importing messages with attachments.
 S: The current solution is to directly modify RubyMail. Change line 159 of
index 6ec8be9457ab6fd006b3c50672d3377a43769151..646b9bfc03a55327e27a8ee86a09a9a332eb9ac8 100644 (file)
@@ -7,11 +7,12 @@ anything into its index yet, and has no idea where to look for them
 anyways.
 
 If you want to play around a little at this point, you can press 'b'
-to cycle between buffers and 'x' to kill a buffer. There's probably
-not too much interesting there, but there's a log buffer with some
-cryptic messages. You can also press '?' at any point to get a list of
-keyboard commands, but in the absence of any email, these will be
-mostly useless. When you get bored, press 'q' to quit.
+to cycle between buffers, ';' to get a list of the open buffers, and
+'x' to kill a buffer. There's probably not too much interesting there,
+but there's a log buffer with some cryptic messages. You can also
+press '?' at any point to get a list of keyboard commands, but in the
+absence of any email, these will be mostly useless. When you get
+bored, press 'q' to quit.
 
 To use Sup for email, we need to load messages into the index. The
 index is where Sup stores all message state (e.g. read or unread, any
@@ -20,18 +21,17 @@ threading messages. Sup only knows about messages in its index.
 
 We can add messages to the index by telling Sup about the "source"
 where the messages reside. Sources are things like IMAP folders, mbox
-folders, maildir directories, and Gmail accounts (in the future). Sup
-doesn't duplicate the actual message content in the index; it only
-stores whatever information is necessary for searching, threading and
-labelling. So when you search for messages or view your inbox, Sup
-talks only to the index (stored locally on disk). When you view a
-thread, Sup requests the full content of all the messages from the
-source.
+folders, and maildir directories. Sup doesn't duplicate the actual
+message content in the index; it only stores whatever information is
+necessary for searching, threading and labelling. So when you search
+for messages or view your inbox, Sup talks only to the index (stored
+locally on disk). When you view a thread, Sup requests the full
+content of all the messages from the source.
 
 The easiest way to set up all your sources is to run `sup-config`.
 This will interactively walk you through some basic configuration,
 prompt you for all the sources you need, and optionally import
-messages from them. Sup-config uses two other tools, sup-add and
+messages from them.  Sup-config uses two other tools, sup-add and
 sup-sync, to load messages into the index. In the future you may make
 use of these tools directly (see below).
 
@@ -49,7 +49,8 @@ results of a search. I mentioned above that your inbox is, by
 definition, the set of all messages that aren't archived. This means
 that your inbox is nothing more than the result of the search for all
 messages with the label "inbox". (It's actually slightly more
-complicated---we omit messages marked as killed, deleted or spam.)
+complicated---we also omit messages marked as killed, deleted or
+spam.)
 
 You could replicate the folder paradigm easily under this scheme, by
 giving each message exactly one label and only viewing the results of
@@ -59,8 +60,7 @@ labels judiciously for things that are too hard to find with search.
 The idea is that a labeling system that allows arbitrary, user-defined
 labels, supplemented by a quick and easy-to-access search mechanism
 provides all the functionality that folders does, plus much more, at a
-far lower cost to the user. (The Sup philosophical treatise has a
-little more on this.)
+far lower cost to the user.
 
 Now let's take a look at your inbox. You'll see that Sup groups
 messages together into threads: each line in the inbox is a thread,
@@ -88,19 +88,25 @@ expand or collapse all messages or 'N' to expand only the new
 messages. You'll also notice that Sup hides quoted text and
 signatures. If you highlight a particular hidden chunk, you can press
 enter to expand it, or you can press 'o' to toggle every hidden chunk
-in a particular message. (Remember, you can hit '?' to see the full
-list of keyboard commands at any point.)
+in a particular message.
 
-A few other useful commands while viewing a thread. Press 'd' to
-toggle a detailed header for a message. If you've scrolled too far to
-the right, press '[' to jump all the way to the left. Finally, you can
-press 'n' and 'p' to jump forward and backward between open messages,
-aligning the display as necessary.
+Other useful keyboard commands when viewing a thread are: 'n' and 'p'
+to jump to the next and previous open messages, 'h' to toggle the
+detailed headers for the current message, and enter to expand or
+collapse the current message (when it's on a text region). Enter and
+'n' in combination are useful for scanning through a thread---press
+enter to close the current message and jump to the next open one, and
+'n' to keep it open and jump. If the buffer is misaligned with a
+message, you can press 'z' to highlight it.
+
+This is a lot to remember, but you can always hit '?' to see the full
+list of keyboard commands at any point. There's a lot of useful stuff
+in there---once you learn some, try out some of the others!
 
 Now press 'x' to kill the thread view buffer. You should see the inbox
-again. If you don't, you can cycle through the buffers by pressing 'b'
-and 'B' (forwards and backwards, respectively), or you can press ';' to
-see a list of all buffers and simply select the inbox.
+again. If you don't, you can cycle through the buffers by pressing
+'b', or you can press ';' to see a list of all buffers and simply
+select the inbox.
 
 There are many operations you can perform on threads beyond viewing
 them. To archive a thread, press 'a'. The thread will disappear from
@@ -108,8 +114,8 @@ your inbox, but will still appear in search results. If someone
 replies an archived thread, it will reappear in your inbox. To kill a
 thread, press '&'. Killed threads will never come back to your inbox,
 even if people reply, but will still be searchable. (This is useful
-for those interminable threads that you really have no interest in,
-but which seem to pop up on every mailing list.)
+for those interminable threads that you really have no immediate
+interest in, but which seem to pop up on every mailing list.)
 
 If a thread is spam, press 'S'. It will disappear and won't come back.
 It won't even appear in search results, unless you explicitly search
@@ -125,8 +131,8 @@ in the labels as a sequence of space-separated words. To cancel the
 input, press Ctrl-G.
 
 Many of these operations can be applied to a group of threads. Press
-'t' to tag a thread. Tag a couple, then press '+' to apply the next
-command to the set of threads. '+t', of course, will untag all tagged
+'t' to tag a thread. Tag a couple, then press '=' to apply the next
+command to the set of threads. '=t', of course, will untag all tagged
 messages.
 
 Ok, let's try using labels and search. Press 'L' to do a quick label
@@ -188,7 +194,7 @@ how to invoke sup-sync when it detects a problem. This is a
 complication you will almost certainly run in to if you use both Sup
 and another MUA on the same source, so it's good to be aware of it.
 
-Have fun, and let me know if you have any problems!
+Have fun, and email sup-talk@rubyforge.org if you have any problems!
 
 Appendix A: sup-add and sup-sync
 ---------------------------------
@@ -233,17 +239,17 @@ Sup-sync will now load all the messages from the source into the
 index. Depending on the size of the source, this may take a while.
 Don't panic! It's a one-time process.
 
-Appendix B: Handling high-volume mailing lists
-----------------------------------------------
-
-Here's what I recommend:
-1. Use procmail to filter messages from the list into a distinct source.
-2. Add that source to Sup as a usual source with auto-archive turned
-   on, and with a label corresponding to the mailing list name.
-   (E.g.: sup-add mbox:/home/me/Mail/ruby-talk -a -l ruby-talk)
-3. Voila! Sup will load new messages into the index but not into the
-   inbox, and you can browse the mailing list traffic at any point by
-   searching for that label.
+Appendix B: Automatically labeling incoming email
+-------------------------------------------------
+
+One option is to filter incoming email into different sources with
+something like procmail, and have each of these sources auto-apply
+labels by using sup-add --labels.
+
+But the better option is to learn Ruby and write a before-add hook.
+This will allow you to apply labels based on whatever crazy logic you
+can come up with. See http://sup.rubyforge.org/wiki/wiki.pl?Hooks for
+examples.
 
 Appendix C: Reading blogs with Sup
 ----------------------------------
index 4f59eaaf13caf6f1c5187af73bc7f4b26201a24b..83738204ed0ba6cee8bb466b5eeb15085cc1ad09 100644 (file)
@@ -5,6 +5,10 @@ require 'thread'
 require 'fileutils'
 require 'gettext'
 require 'curses'
+begin
+  require 'fastthread'
+rescue LoadError
+end
 
 class Object
   ## this is for debugging purposes because i keep calling #id on the
@@ -244,7 +248,7 @@ end
     Redwood::log "using character set encoding #{$encoding.inspect}"
   else
     Redwood::log "warning: can't find character set by using locale, defaulting to utf-8"
-    $encoding = "utf-8"
+    $encoding = "UTF-8"
   end
 
 ## now everything else (which can feel free to call Redwood::log at load time)
index 6f0acf9852ea51d4b45125d035476051ed42d2f4..8eedf9697c26f1aa94c8a6769aa4f7c9e5752406 100644 (file)
@@ -108,10 +108,16 @@ class Buffer
 
     @w.attrset Colormap.color_for(opts[:color] || :none, opts[:highlight])
     s ||= ""
-    maxl = @width - x
-    @w.mvaddstr y, x, s[0 ... maxl]
-    unless s.length >= maxl || opts[:no_fill]
-      @w.mvaddstr(y, x + s.length, " " * (maxl - s.length))
+    maxl = @width - x # maximum display width width
+    stringl = maxl    # string "length"
+    ## the next horribleness is thanks to ruby's lack of widechar support
+    stringl += 1 while stringl < s.length && s[0 ... stringl].display_length < maxl
+    @w.mvaddstr y, x, s[0 ... stringl]
+    unless opts[:no_fill]
+      l = s.display_length
+      unless l >= maxl
+        @w.mvaddstr(y, x + l, " " * (maxl - l))
+      end
     end
   end
 
index e403570a74b39774d7ceefa046722d3dae3c12bb..ca01ee76cc89c118933c5122b616b4b6f45a59bb 100644 (file)
@@ -2,7 +2,6 @@
 
 require 'fileutils'
 require 'ferret'
-require 'fastthread'
 
 begin
   require 'chronic'
index 76c7139f45eb9478a627e49ac7c87eea81d0ee5d..cb039e44788f164e30f8851ce1fe10803a65f566 100644 (file)
@@ -9,22 +9,22 @@ class Keymap
 
   def self.keysym_to_keycode k
     case k
-    when :down: Curses::KEY_DOWN
-    when :up: Curses::KEY_UP
-    when :left: Curses::KEY_LEFT
-    when :right: Curses::KEY_RIGHT
-    when :page_down: Curses::KEY_NPAGE
-    when :page_up: Curses::KEY_PPAGE
-    when :backspace: Curses::KEY_BACKSPACE
-    when :home: Curses::KEY_HOME
-    when :end: Curses::KEY_END
-    when :ctrl_l: "\f"[0]
-    when :ctrl_g: "\a"[0]
-    when :tab: "\t"[0]
-    when :enter, :return: 10 #Curses::KEY_ENTER
+    when :down then Curses::KEY_DOWN
+    when :up then Curses::KEY_UP
+    when :left then Curses::KEY_LEFT
+    when :right then Curses::KEY_RIGHT
+    when :page_down then Curses::KEY_NPAGE
+    when :page_up then Curses::KEY_PPAGE
+    when :backspace then Curses::KEY_BACKSPACE
+    when :home then Curses::KEY_HOME
+    when :end then Curses::KEY_END
+    when :ctrl_l then "\f".ord
+    when :ctrl_g then "\a".ord
+    when :tab then "\t".ord
+    when :enter, :return then 10 #Curses::KEY_ENTER
     else
       if k.is_a?(String) && k.length == 1
-        k[0]
+        k.ord
       else
         raise ArgumentError, "unknown key name '#{k}'"
       end
@@ -33,18 +33,18 @@ class Keymap
 
   def self.keysym_to_string k
     case k
-    when :down: "<down arrow>"
-    when :up: "<up arrow>"
-    when :left: "<left arrow>"
-    when :right: "<right arrow>"
-    when :page_down: "<page down>"
-    when :page_up: "<page up>"
-    when :backspace: "<backspace>"
-    when :home: "<home>"
-    when :end: "<end>"
-    when :enter, :return: "<enter>"
-    when :tab: "tab"
-    when " ": "<space>"
+    when :down then "<down arrow>"
+    when :up then "<up arrow>"
+    when :left then "<left arrow>"
+    when :right then "<right arrow>"
+    when :page_down then "<page down>"
+    when :page_up then "<page up>"
+    when :backspace then "<backspace>"
+    when :home then "<home>"
+    when :end then "<end>"
+    when :enter, :return then "<enter>"
+    when :tab then "tab"
+    when " " then "<space>"
     else
       Curses::keyname(keysym_to_keycode(k))
     end
index 0d941b1d8ae341b86bcf6303e752c3c4bb1c36e5..e1e3a4d1aed75c0a3d190cdc9ce8257ff46a56e4 100644 (file)
@@ -1,7 +1,6 @@
 require "sup/mbox/loader"
 require "sup/mbox/ssh-file"
 require "sup/mbox/ssh-loader"
-require "sup/rfc2047"
 
 module Redwood
 
index 1bf779612f4c135d00b8343efb4ee8971efe32d6..0d742d99e746a9ce96a4c11eddcd57506fcae22f 100644 (file)
@@ -99,7 +99,7 @@ EOS
       text =
         case @content_type
         when /^text\/plain\b/
-          Message.convert_from @raw_content, encoded_content.charset
+          Iconv.easy_decode $encoding, encoded_content.charset || $encoding, @raw_content
         else
           HookManager.run "mime-decode", :content_type => content_type,
                           :filename => lambda { write_to_disk },
@@ -240,8 +240,8 @@ EOS
 
     def patina_color
       case status
-      when :valid: :cryptosig_valid_color
-      when :invalid: :cryptosig_invalid_color
+      when :valid then :cryptosig_valid_color
+      when :invalid then :cryptosig_invalid_color
       else :cryptosig_unknown_color
       end
     end
index 6dd1f7dfa3fa67ed9dd70a39460fa0d08ec73537..ded577aa4f9d953a8e7cacd44708b626f51d00ec 100644 (file)
@@ -1,10 +1,7 @@
 require 'time'
-require 'iconv'
 
 module Redwood
 
-class MessageFormatError < StandardError; end
-
 ## a Message is what's threaded.
 ##
 ## it is also where the parsing for quotes and signatures is done, but
@@ -29,7 +26,6 @@ class Message
 
   QUOTE_PATTERN = /^\s{0,4}[>|\}]/
   BLOCK_QUOTE_PATTERN = /^-----\s*Original Message\s*----+$/
-  QUOTE_START_PATTERN = /\w.*:$/
   SIG_PATTERN = /(^-- ?$)|(^\s*----------+\s*$)|(^\s*_________+\s*$)|(^\s*--~--~-)|(^\s*--\+\+\*\*==)/
 
   MAX_SIG_DISTANCE = 15 # lines from the end
@@ -64,6 +60,13 @@ class Message
   end
 
   def parse_header header
+    ## forcibly decode these headers from and to the current encoding,
+    ## which serves to strip out characters that aren't displayable
+    ## (and which would otherwise be screwing up the display)
+    %w(from to subject cc bcc).each do |f|
+      header[f] = Iconv.easy_decode($encoding, $encoding, header[f]) if header[f]
+    end
+
     @id = if header["message-id"]
       mid = header["message-id"] =~ /<(.+?)>/ ? $1 : header["message-id"]
       sanitize_message_id mid
@@ -73,7 +76,7 @@ class Message
       #Redwood::log "faking non-existent message-id for message from #{from}: #{id}"
       id
     end
-    
+
     @from = Person.from_address(if header["from"]
       header["from"]
     else
@@ -204,7 +207,7 @@ class Message
           ## so i will keep this.
           parse_header @source.load_header(@source_info)
           message_to_chunks @source.load_message(@source_info)
-        rescue SourceError, SocketError, MessageFormatError => e
+        rescue SourceError, SocketError => e
           Redwood::log "problem getting messages from #{@source}: #{e.message}"
           ## we need force_to_top here otherwise this window will cover
           ## up the error message one
@@ -402,8 +405,8 @@ private
         elsif m.header["Content-Type"] && m.header["Content-Type"] !~ /^text\/plain/
           extension =
             case m.header["Content-Type"]
-            when /text\/html/: "html"
-            when /image\/(.*)/: $1
+            when /text\/html/ then "html"
+            when /image\/(.*)/ then $1
             end
 
           ["sup-attachment-#{Time.now.to_i}-#{rand 10000}", extension].join(".")
@@ -421,24 +424,15 @@ private
 
       ## otherwise, it's body text
       else
-        body = Message.convert_from m.decode, m.charset if m.body
+        ## if there's no charset, use the current encoding as the charset.
+        ## this ensures that the body is normalized to avoid non-displayable
+        ## characters
+        body = Iconv.easy_decode($encoding, m.charset || $encoding, m.decode) if m.body
         text_to_chunks((body || "").normalize_whitespace.split("\n"), encrypted)
       end
     end
   end
 
-  def self.convert_from body, charset
-    begin
-      raise MessageFormatError, "RubyMail decode returned a null body" unless body
-      return body unless charset
-      Iconv.easy_decode($encoding, charset, body)
-    rescue Errno::EINVAL, Iconv::InvalidEncoding, Iconv::IllegalSequence, MessageFormatError => e
-      Redwood::log "warning: error (#{e.class.name}) decoding message body from #{charset}: #{e.message}"
-      File.open(File.join(BASE_DIR,"unable-to-decode.txt"), "w") { |f| f.write body }
-      body
-    end
-  end
-
   ## parse the lines of text into chunk objects.  the heuristics here
   ## need tweaking in some nice manner. TODO: move these heuristics
   ## into the classes themselves.
@@ -454,7 +448,11 @@ private
       when :text
         newstate = nil
 
-        if line =~ QUOTE_PATTERN || (line =~ QUOTE_START_PATTERN && nextline =~ QUOTE_PATTERN)
+        ## the following /:$/ followed by /\w/ is an attempt to detect the
+        ## start of a quote. this is split into two regexen because the
+        ## original regex /\w.*:$/ had very poor behavior on long lines
+        ## like ":a:a:a:a:a" that occurred in certain emails.
+        if line =~ QUOTE_PATTERN || (line =~ /:$/ && line =~ /\w/ && nextline =~ QUOTE_PATTERN)
           newstate = :quote
         elsif line =~ SIG_PATTERN && (lines.length - i) < MAX_SIG_DISTANCE
           newstate = :sig
index d7bd41c692f55a7fe7f23f0ebb608e506f938f06..f956d6587948cb3cc01f0579faa98f548850c1d6 100644 (file)
@@ -2,7 +2,10 @@ require 'tempfile'
 require 'socket' # just for gethostname!
 require 'pathname'
 require 'rmail'
-require 'jcode' # for RE_UTF8
+
+# from jcode.rb, not included in ruby 1.9
+PATTERN_UTF8 = '[\xc0-\xdf][\x80-\xbf]|[\xe0-\xef][\x80-\xbf][\x80-\xbf]'
+RE_UTF8 = Regexp.new(PATTERN_UTF8, 0, 'n')
 
 module Redwood
 
@@ -181,7 +184,7 @@ protected
   end
 
   def mime_encode_subject string
-    return string unless string.match(String::RE_UTF8)
+    return string unless string.match(RE_UTF8)
     mime_encode string
   end
 
@@ -190,7 +193,7 @@ protected
   # Encode "bælammet mitt <user@example.com>" into
   # "=?utf-8?q?b=C3=A6lammet_mitt?= <user@example.com>
   def mime_encode_address string
-    return string unless string.match(String::RE_UTF8)
+    return string unless string.match(RE_UTF8)
     string.sub(RE_ADDRESS) { |match| mime_encode($1) + $2 }
   end
 
index 6b9f55933a6ef967fc221f8b31a6f209e48bbe84..c79c5dbe51dd59df0426572c523a2b79492f524f 100644 (file)
@@ -126,7 +126,7 @@ EOS
                "To" => [],
                "Cc" => [],
                "Bcc" => [],
-               "In-Reply-To" => "<#{@m.id}>",
+               "In-reply-to" => "<#{@m.id}>",
                "Subject" => Message.reify_subj(@m.subj),
                "References" => refs,
              }.merge v
index 05fe201c224d8cd9d423c1b704cc5f95a790b8c7..63b48ec00edd6e7b7cc50bd82b51d8b00c7c7ed9 100644 (file)
@@ -219,24 +219,25 @@ protected
 
   def draw_line_from_array ln, a, opts
     xpos = 0
-    a.each do |color, text|
+    a.each_with_index do |(color, text), i|
       raise "nil text for color '#{color}'" if text.nil? # good for debugging
+      l = text.display_length
+      no_fill = i != a.size - 1
       
-      if xpos + text.display_length < @leftcol
+      if xpos + l < @leftcol
         buffer.write ln - @topline, 0, "", :color => color,
                      :highlight => opts[:highlight]
-        xpos += text.display_length
       elsif xpos < @leftcol
         ## partial
         buffer.write ln - @topline, 0, text[(@leftcol - xpos) .. -1],
                      :color => color,
-                     :highlight => opts[:highlight]
-        xpos += text.display_length
+                     :highlight => opts[:highlight], :no_fill => no_fill
       else
         buffer.write ln - @topline, xpos - @leftcol, text,
-                     :color => color, :highlight => opts[:highlight]
-        xpos += text.display_length
+                     :color => color, :highlight => opts[:highlight],
+                     :no_fill => no_fill
       end
+      xpos += l
     end
   end
 
index 9b44ee35c7ee2d6091b6dc5b0a82aec98b8dfb21..145c6eb7cf605290a4a7a3f7f09d111b5235d5f0 100644 (file)
@@ -842,10 +842,11 @@ protected
       [subj_color, size_widget_text],
       [:to_me_color, t.labels.member?(:attachment) ? "@" : " "],
       [:to_me_color, dp ? ">" : (p ? '+' : " ")],
-      [subj_color, t.subj + (t.subj.empty? ? "" : " ")],
     ] +
-      (t.labels - @hidden_labels).map { |label| [:label_color, "+#{label} "] } +
-      [[:snippet_color, snippet]
+      (t.labels - @hidden_labels).map { |label| [:label_color, "#{label} "] } +
+      [
+      [subj_color, t.subj + (t.subj.empty? ? "" : " ")],
+      [:snippet_color, snippet],
     ]
   end
 
index 42c62809fa8f80cb10c4730948de7fa4a208eff6..759191ea5c2466865dfc162690e72d3878498b9c 100644 (file)
@@ -24,9 +24,22 @@ Return value:
   None. The variable 'headers' should be modified in place.
 EOS
 
+  HookManager.register "bounce-command", <<EOS
+Determines the command used to bounce a message.
+Variables:
+      from: The From header of the message being bounced
+            (eg: likely _not_ your address).
+        to: The addresses you asked the message to be bounced to as an array.
+Return value:
+  A string representing the command to pipe the mail into.  This
+  should include the entire command except for the destination addresses,
+  which will be appended by sup.
+EOS
+
   register_keymap do |k|
     k.add :toggle_detailed_header, "Toggle detailed header", 'h'
     k.add :show_header, "Show full message header", 'H'
+    k.add :show_message, "Show full message (raw form)", 'V'
     k.add :activate_chunk, "Expand/collapse or activate item", :enter
     k.add :expand_all_messages, "Expand/collapse all messages", 'E'
     k.add :edit_draft, "Edit draft", 'e'
@@ -41,6 +54,7 @@ EOS
 #    k.add :collapse_non_new_messages, "Collapse all but unread messages", 'N'
     k.add :reply, "Reply to a message", 'r'
     k.add :forward, "Forward a message or attachment", 'f'
+    k.add :bounce, "Bounce message to other recipient(s)", '!'
     k.add :alias, "Edit alias/nickname for a person", 'i'
     k.add :edit_as_new, "Edit message as new", 'D'
     k.add :save_to_disk, "Save message/attachment to disk", 's'
@@ -134,6 +148,13 @@ EOS
     end
   end
 
+  def show_message
+    m = @message_lines[curpos] or return
+    BufferManager.spawn_unless_exists("Raw message for #{m.id}") do
+      TextMode.new m.raw_message
+    end
+  end
+
   def toggle_detailed_header
     m = @message_lines[curpos] or return
     @layout[m].state = (@layout[m].state == :detailed ? :open : :detailed)
@@ -172,6 +193,38 @@ EOS
     end
   end
 
+  def bounce
+    m = @message_lines[curpos] or return
+    to = BufferManager.ask_for_contacts(:people, "Bounce To: ") or return
+
+    defcmd = AccountManager.default_account.sendmail.sub(/\s(\-(ti|it|t))\b/) do |match|
+      case "$1"
+        when '-t' then ''
+        else ' -i'
+      end
+    end
+
+    cmd = case HookManager.run "bounce-command", :from => m.from, :to => to
+          when nil, /^$/ then defcmd
+          else hookcmd
+          end + ' ' + to.map { |t| t.email }.join(' ')
+
+    bt = to.size > 1 ? "#{to.size} recipients" : to.to_s
+
+    if BufferManager.ask_yes_or_no "Really bounce to #{bt}?"
+      Redwood::log "Bounce Command: #{cmd}"
+      begin
+        IO.popen(cmd, 'w') do |sm|
+          sm.puts m.raw_message
+        end
+        raise SendmailCommandFailed, "Couldn't execute #{cmd}" unless $? == 0
+      rescue SystemCallError, SendmailCommandFailed => e
+        Redwood::log "Problem sending mail: #{e.message}"
+        BufferManager.flash "Problem sending mail: #{e.message}"
+      end
+    end
+  end
+
   include CanAliasContacts
   def alias
     p = @person_lines[curpos] or return
@@ -234,12 +287,16 @@ EOS
   ## view.
   def activate_chunk
     chunk = @chunk_lines[curpos] or return
-    layout = 
-      if chunk.is_a?(Message)
-        @layout[chunk]
-      elsif chunk.expandable?
-        @chunk_layout[chunk]
-      end
+    if chunk.is_a? Chunk::Text
+      ## if the cursor is over a text region, expand/collapse the
+      ## entire message
+      chunk = @message_lines[curpos]
+    end
+    layout = if chunk.is_a?(Message)
+      @layout[chunk]
+    elsif chunk.expandable?
+      @chunk_layout[chunk]
+    end
     if layout
       layout.state = (layout.state != :closed ? :closed : :open)
       #cursor_down if layout.state == :closed # too annoying
@@ -247,6 +304,10 @@ EOS
     elsif chunk.viewable?
       view chunk
     end
+    if chunk.is_a?(Message)
+      jump_to_message chunk
+      jump_to_next_open if layout.state == :closed
+    end
   end
 
   def edit_as_new
index 6f9e398c5b5f956862cc6b962e4522054b055aca..74f7d1ce67765c668e73de67afa4a0de97478e00 100644 (file)
@@ -148,23 +148,19 @@ EOS
         labels.each { |l| LabelManager << l }
         labels = labels + (source.archived? ? [] : [:inbox])
 
-        begin
-          m = Message.new :source => source, :source_info => offset, :labels => labels
-          m.load_from_source!
-
-          if m.source_marked_read?
-            m.remove_label :unread
-            labels.delete :unread
-          end
+        m = Message.new :source => source, :source_info => offset, :labels => labels
+        m.load_from_source!
 
-          docid, entry = Index.load_entry_for_id m.id
-          HookManager.run "before-add-message", :message => m
-          m = yield(m, offset, entry) or next if block_given?
-          times = Index.sync_message m, false, docid, entry, opts
-          UpdateManager.relay self, :added, m unless entry
-        rescue MessageFormatError => e
-          Redwood::log "ignoring erroneous message at #{source}##{offset}: #{e.message}"
+        if m.source_marked_read?
+          m.remove_label :unread
+          labels.delete :unread
         end
+
+        docid, entry = Index.load_entry_for_id m.id
+        HookManager.run "before-add-message", :message => m
+        m = yield(m, offset, entry) or next if block_given?
+        times = Index.sync_message m, false, docid, entry, opts
+        UpdateManager.relay self, :added, m unless entry
       end
     rescue SourceError => e
       Redwood::log "problem getting messages from #{source}: #{e.message}"
index 91cd71f4da2461034719cced8990b243f8cf2364..fb98dbc71a1bdfee155225a74ab0f860706893bf 100644 (file)
@@ -1,3 +1,5 @@
+require "sup/rfc2047"
+
 module Redwood
 
 class SourceError < StandardError
index b479908e1263dc1384537c72c2d0c9fcaf4c9146..8f60cc43216979aaa207696324f117ba7025cbdd 100644 (file)
@@ -133,8 +133,8 @@ class Object
   ## clone of java-style whole-method synchronization
   ## assumes a @mutex variable
   ## TODO: clean up, try harder to avoid namespace collisions
-  def synchronized *meth
-    meth.each do
+  def synchronized *methods
+    methods.each do |meth|
       class_eval <<-EOF
         alias unsynchronized_#{meth} #{meth}
         def #{meth}(*a, &b)
@@ -144,8 +144,8 @@ class Object
     end
   end
 
-  def ignore_concurrent_calls *meth
-    meth.each do
+  def ignore_concurrent_calls *methods
+    methods.each do |meth|
       mutex = "@__concurrent_protector_#{meth}"
       flag = "@__concurrent_flag_#{meth}"
       oldmeth = "__unprotected_#{meth}"
@@ -172,7 +172,15 @@ class Object
 end
 
 class String
-  def display_length; scan(/./u).size end
+  ## nasty multibyte hack for ruby 1.8. if it's utf-8, split into chars using
+  ## the utf8 regex and count those. otherwise, use the byte length.
+  def display_length
+    if $encoding == "UTF-8"
+      scan(/./u).size
+    else
+      size
+    end
+  end
 
   def camel_to_hyphy
     self.gsub(/([a-z])([A-Z0-9])/, '\1-\2').downcase
@@ -205,7 +213,7 @@ class String
     region_start = 0
     while pos <= length
       newpos = case state
-        when :escaped_instring, :escaped_outstring: pos
+        when :escaped_instring, :escaped_outstring then pos
         else index(/[,"\\]/, pos)
       end 
       
@@ -219,26 +227,26 @@ class String
       case char
       when ?"
         state = case state
-          when :outstring: :instring
-          when :instring: :outstring
-          when :escaped_instring: :instring
-          when :escaped_outstring: :outstring
+          when :outstring then :instring
+          when :instring then :outstring
+          when :escaped_instring then :instring
+          when :escaped_outstring then :outstring
         end
       when ?,, nil
         state = case state
-          when :outstring, :escaped_outstring:
+          when :outstring, :escaped_outstring then
             ret << self[region_start ... newpos].gsub(/^\s+|\s+$/, "")
             region_start = newpos + 1
             :outstring
-          when :instring: :instring
-          when :escaped_instring: :instring
+          when :instring then :instring
+          when :escaped_instring then :instring
         end
       when ?\\
         state = case state
-          when :instring: :escaped_instring
-          when :outstring: :escaped_outstring
-          when :escaped_instring: :instring
-          when :escaped_outstring: :outstring
+          when :instring then :escaped_instring
+          when :outstring then :escaped_outstring
+          when :escaped_instring then :instring
+          when :escaped_outstring then :outstring
         end
       end
       pos = newpos + 1
@@ -274,6 +282,12 @@ class String
     gsub(/\t/, "    ").gsub(/\r/, "")
   end
 
+  if not defined? ord
+    def ord
+      self[0]
+    end
+  end
+
   ## takes a space-separated list of words, and returns an array of symbols.
   ## typically used in Sup for translating Ferret's representation of a list
   ## of labels (a string) to an array of label symbols.
@@ -628,16 +642,18 @@ class Iconv
   def self.easy_decode target, charset, text
     return text if charset =~ /^(x-unknown|unknown[-_ ]?8bit|ascii[-_ ]?7[-_ ]?bit)$/i
     charset = case charset
-                when /UTF[-_ ]?8/i: "utf-8"
-                when /(iso[-_ ])?latin[-_ ]?1$/i: "ISO-8859-1"
-                when /iso[-_ ]?8859[-_ ]?15/i: 'ISO-8859-15'
-                when /unicode[-_ ]1[-_ ]1[-_ ]utf[-_]7/i: "utf-7"
-                else charset
-              end
-
-    # Convert:
-    #
-    # Remember - Iconv.open(to, from)!
-    Iconv.iconv(target + "//IGNORE", charset, text + " ").join[0 .. -2]
+      when /UTF[-_ ]?8/i then "utf-8"
+      when /(iso[-_ ])?latin[-_ ]?1$/i then "ISO-8859-1"
+      when /iso[-_ ]?8859[-_ ]?15/i then 'ISO-8859-15'
+      when /unicode[-_ ]1[-_ ]1[-_ ]utf[-_]7/i then "utf-7"
+      else charset
+    end
+
+    begin
+      Iconv.iconv(target + "//IGNORE", charset, text + " ").join[0 .. -2]
+    rescue Errno::EINVAL, Iconv::InvalidEncoding, Iconv::IllegalSequence => e
+      Redwood::log "warning: error (#{e.class.name}) decoding text from #{charset} to #{target}: #{text[0 ... 20]}"
+      text
+    end
   end
 end
diff --git a/sup.gemspec b/sup.gemspec
deleted file mode 100644 (file)
index 506d8ad..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-$:.push "lib"
-
-require "sup-files"
-require "sup-version"
-
-Gem::Specification.new do |s|
-  s.name = %q{sup}
-  s.version = SUP_VERSION
-  s.date = Time.now.to_s
-  s.authors = ["William Morgan"]
-  s.email = %q{wmorgan-sup@masanjin.net}
-  s.summary = %q{A console-based email client with the best features of GMail, mutt, and emacs. Features full text search, labels, tagged operations, multiple buffers, recent contacts, and more.}
-  s.homepage = %q{http://sup.rubyforge.org/}
-  s.description = %q{Sup is a console-based email client for people with a lot of email. It supports tagging, very fast full-text search, automatic contact-list management, and more. If you're the type of person who treats email as an extension of your long-term memory, Sup is for you.  Sup makes it easy to: - Handle massive amounts of email.  - Mix email from different sources: mbox files (even across different machines), Maildir directories, IMAP folders, POP accounts, and GMail accounts.  - Instantaneously search over your entire email collection. Search over body text, or use a query language to combine search predicates in any way.  - Handle multiple accounts. Replying to email sent to a particular account will use the correct SMTP server, signature, and from address.  - Add custom code to handle certain types of messages or to handle certain types of text within messages.  - Organize email with user-defined labels, automatically track recent contacts, and much more!  The goal of Sup is to become the email client of choice for nerds everywhere.}
-  s.files = SUP_FILES
-  s.executables = SUP_EXECUTABLES
-
-  s.add_dependency "ferret", ">= 0.11.6"
-  s.add_dependency "ncurses", ">= 0.9.1"
-  s.add_dependency "rmail", ">= 0.17"
-  s.add_dependency "highline"
-  s.add_dependency "net-ssh"
-  s.add_dependency "trollop", ">= 1.12"
-  s.add_dependency "lockfile"
-  s.add_dependency "mime-types", "~> 1"
-  s.add_dependency "gettext"
-  s.add_dependency "fastthread"
-
-  puts s.files
-end 
index bdf40e97822db4102aefc836d8505dd0044570b5..272abc02536c045a4b2218ecc7537a54fb4a4a16 100644 (file)
@@ -3,7 +3,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
        <head>
                <title>Sup</title>
-               <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+               <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                <link rel="stylesheet" href="main.css" type="text/css" />
        </head>
 
                <h2>Status</h2>
 
                <p>
-               The current version of Sup is 0.7, released 2009-03-25. This is a
-               beta release. It supports mbox, mbox over ssh, IMAP, IMAPS, and Maildir mailstores.
+               The current version of Sup is 0.8.1, released 2009-06-15. This is a
+               beta release. It supports mbox, IMAP, IMAPS, and Maildir mailstores.
                </p>
 
+        <p>To be notified by email of Sup releases, subscribe to the
+           <a href="http://rubyforge.org/mailman/listinfo/sup-announce">sup-announce mailing list</a>. One email per release.
+        </p>
+
         <!-- <p>Issue and release status is available on the <a href="ditz/">Sup ditz page</a>.</p> -->
         <p>Sup news can often be see on <a href="http://all-thing.net/label/sup/">William's blog</a>.</p>
 
                <p>
                Sup is brought to you by <a href="http://cs.stanford.edu/~ruby/">William Morgan</a> and the following honorable contributors:
         <ul>
-<li>William Morgan &lt;wmorgan-sup at the masanjin dot nets&gt;</li>
-<li>Ismo Puustinen &lt;ismo at the iki dot fis&gt;</li>
-<li>Nicolas Pouillard &lt;nicolas.pouillard at the gmail dot coms&gt;</li>
-<li>Marcus Williams &lt;marcus-sup at the bar-coded dot nets&gt;</li>
-<li>Lionel Ott &lt;white.magic at the gmx dot des&gt;</li>
-<li>Christopher Warrington &lt;chrisw at the rice dot edus&gt;</li>
-<li>Marc Hartstein &lt;marc.hartstein at the alum.vassar dot edus&gt;</li>
-<li>Ben Walton &lt;bwalton at the artsci.utoronto dot cas&gt;</li>
-<li>Grant Hollingworth &lt;grant at the antiflux dot orgs&gt;</li>
-<li>Steve Goldman &lt;sgoldman at the tower-research dot coms&gt;</li>
-<li>Decklin Foster &lt;decklin at the red-bean dot coms&gt;</li>
-<li>Jeff Balogh &lt;its.jeff.balogh at the gmail dot coms&gt;</li>
-<li>Giorgio Lando &lt;patroclo7 at the gmail dot coms&gt;</li>
-<li>Israel Herraiz &lt;israel.herraiz at the gmail dot coms&gt;</li>
-<li>Ian Taylor &lt;ian at the lorf dot orgs&gt;</li>
-<li>Rich Lane &lt;rlane at the club.cc.cmu dot edus&gt;</li>
+<li>Nicolas Pouillard </li>
+<li>Mike Stipicevic </li>
+<li>Marcus Williams </li>
+<li>Lionel Ott </li>
+<li>Ingmar Vanhassel </li>
+<li>Mark Alexander </li>
+<li>Christopher Warrington </li>
+<li>Richard Brown </li>
+<li>Ben Walton </li>
+<li>Marc Hartstein </li>
+<li>Grant Hollingworth </li>
+<li>Steve Goldman </li>
+<li>Decklin Foster </li>
+<li>Ismo Puustinen </li>
+<li>Jeff Balogh </li>
+<li>Alex Vandiver </li>
+<li>Giorgio Lando </li>
+<li>Israel Herraiz </li>
+<li>Ian Taylor </li>
+<li>Stefan Lundström </li>
+<li>Rich Lane </li>
+<li>Kirill Smelkov </li>
         </ul>
         </p>
 
                <p>
                Sup is made possible by the hard work of <a
                        href="http://www.davebalmain.com/">Dave Balmain</a> and his
-               fantastic IR engine <a
-                       href="http://ferret.davebalmain.com/trac/">Ferret</a>, and by <a
-                       href="http://www.lickey.com/">Matt Armstrong</a>'s tragically
-               abandoned <a href="http://www.rfc20.org/rubymail/">RubyMail</a>
-               package (note: possibly no longer abandoned).
+               tragically abandoned IR engine <a
+                       href="http://ferret.davebalmain.com/trac/">Ferret</a>, and by that of <a
+                       href="http://www.lickey.com/">Matt Armstrong</a> and his
+               tagically abandoned <a href="http://www.rfc20.org/rubymail/">RubyMail</a>
+               package.
                </p>
        </body>
 </html>