debian/0000755000000000000000000000000012244451631007170 5ustar debian/themes/0000755000000000000000000000000012244346643010463 5ustar debian/themes/colors-defaultinverted.yaml0000644000000000000000000000611212244346643016033 0ustar -- :message_patina: # the header line in thread-view :fg: white :bg: magenta :alternate_patina: # alternating header lines look different :fg: white :bg: yellow :generic_notice_patina: :fg: red :bg: default :index_new: # unread mails in inbox look like this :fg: black :bg: default :attrs: - bold :index_old: # old mail in inbox looks like this :fg: black :bg: default :index_draft: :fg: cyan :bg: default :attrs: - bold :index_starred: # starred mails look like this :fg: blue :bg: default :attrs: - bold :label: # color of the label text in any view :fg: blue :bg: default :labellist_new: :fg: black :bg: default :attrs: - bold :labellist_old: :fg: black :bg: default :tagged: :fg: blue :bg: default :attrs: - bold :draft_notification: :fg: cyan :bg: default :attrs: - bold :missing_message: # if you have "an unreceived message" it'll get this colour :fg: white :bg: cyan :starred: # starred mails look like this :fg: blue :bg: default :attrs: - bold :starred_patina: # header line for starred mail in message view :fg: blue :bg: magenta :attrs: - bold :alternate_starred_patina: # they also have alternating design :fg: blue :bg: yellow :attrs: - bold :to_me: # I think this is the little larger-than ">" in inbox view that tells if you're the receiver (as opposed to a mailing list etc) :fg: magenta :bg: default :attachment: :fg: red :bg: default :quote: # colour of quoted message parts :fg: blue :bg: default :quote_patina: # colour of the "folding" line indicating a quote :fg: blue :bg: default :sig: # colour of someone's signature :fg: blue :bg: default :sig_patina: # colour of the "folding" line indicating a signature :fg: blue :bg: default :cryptosig_valid: :fg: blue :bg: default :attrs: - bold :cryptosig_invalid: :fg: blue :bg: cyan :attrs: - bold :cryptosig_unknown: :fg: red :bg: default :snippet: :fg: red :bg: default :system_buf: :fg: yellow :bg: default :regular_buf: :fg: black :bg: default :modified_buffer: :fg: blue :bg: default :attrs: - bold :completion_character: :fg: black :bg: default :attrs: - bold :horizontal_selector_selected: :fg: blue :bg: default :attrs: - bold :horizontal_selector_unselected: :fg: red :bg: default :twiddle: :fg: yellow :bg: default :status: # appearance of the status line at the bottom :fg: black :bg: yellow :attrs: - bold :search_highlight: :fg: white :bg: blue :attrs: - bold :option: :fg: black :bg: default debian/themes/colors-mythicalhacker.yaml0000644000000000000000000000274212244346643015643 0ustar :status: :fg: white :bg: black :attrs: bold :index_old: :fg: black :bg: black :attrs: bold :index_new: :fg: blue :bg: black :attrs: bold :index_starred: :fg: red :bg: black :attrs: bold :labellist_old: :fg: white :bg: black :labellist_new: :fg: white :bg: black :attrs: bold :twiddle: :fg: blue :bg: black :label: :fg: yellow :bg: black :message_patina: :fg: black :bg: green :alternate_patina: :fg: black :bg: blue :missing_message: :fg: cyan :bg: black :cryptosig_valid: :fg: yellow :bg: black :attrs: bold :cryptosig_unknown: :fg: yellow :bg: black :cryptosig_invalid: :fg: yellow :bg: red :attrs: bold :generic_notice_patina: :fg: cyan :bg: black :quote_patina: :fg: yellow :bg: black :sig_patina: :fg: yellow :bg: black :quote: :fg: yellow :bg: black :sig: :fg: yellow :bg: black :to_me: :fg: green :bg: black :starred: :fg: yellow :bg: black :attrs: bold :starred_color: :fg: yellow :bg: green :attrs: bold :alternate_starred_patina: :fg: yellow :bg: blue :attrs: bold :snippet: :fg: black :bg: black :attrs: bold :option: :fg: white :bg: black :tagged: :fg: yellow :bg: black :attrs: bold :draft_notification: :fg: red :bg: black :attrs: bold :completion_character: :fg: white :bg: black :attrs: bold :reply_mode_selected: :fg: yellow :bg: black :attrs: bold :reply_mode_unselected: :fg: cyan :bg: black :reply_mode_label: :fg: cyan :bg: black debian/themes/colors-default.yaml0000644000000000000000000000573512244346643014304 0ustar # Default color scheme for Sup # # Reported by invoking # # ruby -rubygems -rsup 'print Redwood::Colormap::DEFAULT_COLORS.to_yaml' # # Annotations are from the Sup wiki. # # See the Sup wiki for more information # http://sup.rubyforge.org/wiki/wiki.pl?CustomizingColors --- ### inbox view ### :index_new: # new email :fg: white :bg: default :attrs: - bold :index_old: # read email :fg: white :bg: default :index_draft: # draft email :fg: red :bg: default :attrs: - bold :index_starred: # starred email :fg: yellow :bg: default :attrs: - bold :to_me: # @ symbol for attachments and > symbol indicating you are the explicit recipient (as oopposed to a mailing list, etc) :fg: green :bg: default :label: # label of email (shows after subject) :fg: yellow :bg: default :snippet: # snippet text from email (shows after label) :fg: cyan :bg: default :status: # status bar at bottom :fg: white :bg: blue :attrs: - bold ### thread view ### :message_patina: # email header :fg: black :bg: green :alternate_patina: # alt email header :fg: black :bg: blue :missing_message: # missing email detected in thread :fg: black :bg: red :starred_patina: # header for starred emails :fg: yellow :bg: green :attrs: - bold :alternate_starred_patina: :fg: yellow :bg: blue :attrs: - bold :starred: # starred email text :fg: yellow :bg: default :attrs: - bold :quote_patina: # quote header :fg: yellow :bg: default :quote: # quote text :fg: yellow :bg: default :sig_patina: # signature header :fg: yellow :bg: default :sig: # signature text :fg: yellow :bg: default :attachment: # attachments :fg: cyan :bg: default # misc, need organization / comments :cryptosig_valid: :fg: yellow :bg: default :attrs: - bold :cryptosig_valid_untrusted: :fg: yellow :bg: blue :attrs: - bold :cryptosig_invalid: :fg: yellow :bg: red :attrs: - bold :cryptosig_unknown: :fg: cyan :bg: default :twiddle: # ~ chars and empty lines above :status: :fg: blue :bg: default :horizontal_selector_selected: # selected option of e.g. Reply to: :fg: yellow :bg: default :attrs: - bold :horizontal_selector_unselected: # the other options :fg: cyan :bg: default :option: :fg: white :bg: default :system_buf: # e.g. poll-mode line in buffer list :fg: blue :bg: default :regular_buf: # e.g. inbox-mode line in buffer list :fg: white :bg: default :modified_buffer: :fg: yellow :bg: default :attrs: - bold :draft_notification: :fg: red :bg: default :attrs: - bold :generic_notice_patina: :fg: cyan :bg: default :labellist_new: :fg: white :bg: default :attrs: - bold :labellist_old: :fg: white :bg: default :completion_character: :fg: white :bg: default :attrs: - bold :search_highlight: :fg: black :bg: yellow :attrs: - bold :tagged: :fg: yellow :bg: default :attrs: - bold ### unkown values ### :date: :fg: white :bg: default :size_widget: :fg: white :bg: default debian/ruby-tests.rb0000644000000000000000000000015412244346643011644 0ustar $: << 'lib' << 'test' << '.' Dir['test/test_*.rb'].each { |f| require f if not f == 'test/test_crypto.rb' } debian/copyright0000644000000000000000000000742712244451631011135 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: sup Source: Files: * Copyright: 2006-2009 William Morgan License: GPL-2+ Files: lib/sup/rfc2047.rb Copyright: 2004 Sam Roberts License: Ruby or GPL-2+ Files: debian/* Copyright: 2008-2012 Decklin Foster 2012 Per Andersson License: GPL-2+ License: GPL-2+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this program. If not, see . . On Debian systems, the full text of the GNU General Public License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'. License: Ruby Ruby is copyrighted free software by Yukihiro Matsumoto . You can redistribute it and/or modify it under either the terms of the GPL (see the file GPL), or the conditions below: . 1. You may make and give away verbatim copies of the source form of the software without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. . 2. You may modify your copy of the software in any way, provided that you do at least ONE of the following: . a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or by allowing the author to include your modifications in the software. . b) use the modified software only within your corporation or organization. . c) give non-standard binaries non-standard names, with instructions on where to get the original software distribution. . d) make other distribution arrangements with the author. . 3. You may distribute the software in object code or binary form, provided that you do at least ONE of the following: . a) distribute the binaries and library files of the software, together with instructions (in the manual page or equivalent) on where to get the original distribution. . b) accompany the distribution with the machine-readable source of the software. . c) give non-standard binaries non-standard names, with instructions on where to get the original software distribution. . d) make other distribution arrangements with the author. . 4. You may modify and include the part of the software into any other software (possibly commercial). But some files in the distribution are not written by the author, so that they are not under these terms. . For the list of those files and their copying conditions, see the file LEGAL. . 5. The scripts and library files supplied as input to or produced as output from the software do not automatically fall under the copyright of the software, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this software. . 6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. debian/sup-mail.manpages0000644000000000000000000000001512244346643012436 0ustar debian/man/* debian/sup-mail.menu0000644000000000000000000000021412244346643011610 0ustar ?package(sup-mail):needs="text" section="Applications/Network/Communication"\ hints="Mail" title="Sup mailer" command="/usr/bin/sup-mail" debian/control0000644000000000000000000000421712244451631010577 0ustar Source: sup-mail Section: mail Priority: optional Maintainer: Debian Ruby Extras Maintainers Uploaders: Per Andersson DM-Upload-Allowed: yes Build-Depends: debhelper (>= 7.0.50~), gem2deb (>= 0.2.13~), libxapian-ruby1.9.1 (>= 1.2.1), ruby-chronic, ruby-eventmachine, ruby-highline, ruby-locale, ruby-lockfile, ruby-mime-types, ruby-ncurses, ruby-rubymail, ruby-trollop, ruby-yajl Standards-Version: 3.9.3 Vcs-Git: git://git.debian.org/pkg-ruby-extras/sup-mail.git Vcs-Browser: http://git.debian.org/?p=pkg-ruby-extras/sup-mail.git;a=summary Homepage: http://sup.rubyforge.org/ XS-Ruby-Versions: ruby1.9.1 Package: sup-mail Architecture: all XB-Ruby-Versions: ${ruby:Versions} Depends: ruby1.9.1, libxapian-ruby1.9.1 (>= 1.2.1), ruby-chronic, ruby-eventmachine, ruby-highline, ruby-locale, ruby-lockfile, ruby-mime-types, ruby-ncurses, ruby-rubymail, ruby-trollop, ruby-yajl, ${misc:Depends} Recommends: ruby-gpgme Provides: mail-reader Description: thread-centric mailer with tagging and fast search 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. . Sup makes it easy to: * Handle massive amounts of email. * Mix email from different sources: mbox files and Maildirs, across multiple machines. * 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. debian/patches/0000755000000000000000000000000012244451631010617 5ustar debian/patches/0004-Avoid-crash-when-maybe-wrapping-text.patch0000644000000000000000000000144212244451631021223 0ustar From: Per Andersson Date: Sat, 26 May 2012 00:41:29 +0200 Subject: Avoid crash when (maybe) wrapping text. Crash occurs for instance when expanding GPG signatures. --- lib/sup/modes/thread-view-mode.rb | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/lib/sup/modes/thread-view-mode.rb b/lib/sup/modes/thread-view-mode.rb index 9fcc45d..2a8a237 100644 --- a/lib/sup/modes/thread-view-mode.rb +++ b/lib/sup/modes/thread-view-mode.rb @@ -846,7 +846,8 @@ private else width = buffer.content_width end - lines = lines.map { |l| l.chomp.wrap width }.flatten + # sometimes l is nil, avoid crash when this happens + lines = lines.map { |l| l.chomp.wrap width unless l == nil }.flatten end return lines end -- debian/patches/0003-Update-tests-so-they-all-pass.patch0000644000000000000000000001272512244421073017706 0ustar From: Per Andersson Date: Fri, 18 May 2012 23:52:55 +0200 Subject: Update tests so they all pass! --- test/dummy_source.rb | 4 ++-- test/test_header_parsing.rb | 29 +++++++++++++++++++++-------- test/test_message.rb | 27 +++++++++++++++++++-------- 3 files changed, 42 insertions(+), 18 deletions(-) diff --git a/test/dummy_source.rb b/test/dummy_source.rb index da26e44..ec4debf 100644 --- a/test/dummy_source.rb +++ b/test/dummy_source.rb @@ -11,8 +11,8 @@ class DummySource < Source attr_accessor :messages - def initialize uri, last_date=nil, usual=true, archived=false, id=nil, labels=[] - super uri, last_date, usual, archived, id + def initialize uri, usual=true, archived=false, id=nil + super uri, usual, archived, id @messages = nil end diff --git a/test/test_header_parsing.rb b/test/test_header_parsing.rb index 1929e07..60eb968 100644 --- a/test/test_header_parsing.rb +++ b/test/test_header_parsing.rb @@ -106,7 +106,8 @@ EOS end def test_from_line_splitting - l = MBox.new StringIO.new(< To: a dear friend @@ -125,14 +126,21 @@ From bob@bob.com This is the end of the email. EOS - offset, labels = l.next - assert_equal 0, offset - offset, labels = l.next + tmpfile.seek 0 + + l = MBox.new tmpfile + offset = l.next_offset 0 + # I assume it is meant to actually split on the From: line + assert_equal 61, offset + offset = l.next_offset offset assert_nil offset + + tmpfile.close! end def test_more_from_line_splitting - l = MBox.new StringIO.new(< To: a dear friend @@ -145,13 +153,18 @@ To: a dear friend Hello again! Would you like to buy my products? EOS - offset, labels = l.next + tmpfile.seek 0 + + l = MBox.new tmpfile + offset = l.next_offset 0 assert_not_nil offset - offset, labels = l.next + offset = l.next_offset offset assert_not_nil offset - offset, labels = l.next + offset = l.next_offset offset assert_nil offset + + tmpfile.close! end end diff --git a/test/test_message.rb b/test/test_message.rb index 94b962a..f7c8279 100644 --- a/test/test_message.rb +++ b/test/test_message.rb @@ -29,9 +29,14 @@ module Redwood class TestMessage < Test::Unit::TestCase def setup + @path = Dir.mktmpdir + HookManager.init File.join(@path, 'hooks') end def teardown + FileUtils.rm_r @path if passed? + puts "not cleaning up #{@path}" unless passed? + HookManager.deinstantiate! end def test_simple_message @@ -72,7 +77,8 @@ EOS source.messages = [ message ] source_info = 0 - sup_message = Message.new( {:source => source, :source_info => source_info } ) + location = Location.new(source, source_info) + sup_message = Message.new( {:locations => [location] } ) sup_message.load_from_source! # see how well parsing the header went @@ -222,7 +228,8 @@ EOS source.messages = [ message ] source_info = 0 - sup_message = Message.new( {:source => source, :source_info => source_info } ) + location = Location.new(source, source_info) + sup_message = Message.new( {:locations => [location] } ) sup_message.load_from_source! # read the message body chunks @@ -272,7 +279,8 @@ EOS source.messages = [ message ] source_info = 0 - sup_message = Message.new( {:source => source, :source_info => source_info } ) + location = Location.new(source, source_info ) + sup_message = Message.new( {:locations => [location] } ) sup_message.load_from_source! to = sup_message.to @@ -318,7 +326,8 @@ EOS source.messages = [ message ] source_info = 0 - sup_message = Message.new( {:source => source, :source_info => source_info } ) + location = Location.new(source, source_info) + sup_message = Message.new( {:locations => [location] } ) sup_message.load_from_source! # read the message body chunks: no errors should reach this level @@ -417,7 +426,8 @@ EOS source.messages = [ message ] source_info = 0 - sup_message = Message.new( {:source => source, :source_info => source_info } ) + location = Location.new(source, source_info) + sup_message = Message.new( {:locations => [location] } ) sup_message.load_from_source! # read the message body chunks @@ -508,7 +518,8 @@ EOS source.messages = [ message ] source_info = 0 - sup_message = Message.new( {:source => source, :source_info => source_info } ) + location = Location.new(source, source_info) + sup_message = Message.new( {:locations => [location] } ) sup_message.load_from_source! # See how well parsing the message ID went. @@ -517,8 +528,8 @@ EOS # Look at another header field whose first line was blank. list_unsubscribe = sup_message.list_unsubscribe - assert_equal(", " + - "", + assert_equal(",\n" + + " \t", list_unsubscribe) end -- debian/patches/0007-Fix-remote-code-injection-when-viewing-attachments.patch0000644000000000000000000001442712244451631024061 0ustar From: Per Andersson Date: Tue, 19 Nov 2013 19:46:17 +0100 Subject: Fix remote code injection when viewing attachments CVE-2013-4478 and CVE-2013-4479 (Closes: #728232) Backported from 0.13.2.1. --- doc/FAQ.txt | 6 +++++- doc/Hooks.txt | 7 +++++- lib/sup/message-chunks.rb | 55 +++++++++++++++++++++++++++++++++++++---------- 3 files changed, 55 insertions(+), 13 deletions(-) diff --git a/doc/FAQ.txt b/doc/FAQ.txt index 9a24d7f..6600557 100644 --- a/doc/FAQ.txt +++ b/doc/FAQ.txt @@ -112,4 +112,8 @@ P: When I run Sup remotely and view an HTML attachment, an existing file, which it can't find (since it's on the remote machine). How do I view HTML attachments in this environment? S: Put this in your ~/.mailcap on the machine you run Sup on: - text/html; /usr/bin/firefox -a sup '%s'; description=HTML Text; test=test -n "$DISPLAY"; nametemplate=%s.html + text/html; /usr/bin/firefox -a sup %s; description=HTML Text; test=test -n "$DISPLAY"; nametemplate=%s.html + + Please read + https://github.com/sup-heliotrope/sup/wiki/Viewing-Attachments for + some security concerns on opening attachments. diff --git a/doc/Hooks.txt b/doc/Hooks.txt index 21b1e5e..6c33971 100644 --- a/doc/Hooks.txt +++ b/doc/Hooks.txt @@ -48,12 +48,17 @@ before-poll: mime-decode: + ## Please read: + https://github.com/sup-heliotrope/sup/wiki/Viewing-Attachments for + some security concerns on opening attachments. + ## turn text/html attachments into plain text, unless they are part ## of a multipart/alternative pair + require 'shellwords' unless sibling_types.member? "text/plain" case content_type when "text/html" - `/usr/bin/w3m -dump -T #{content_type} '#{filename}'` + `/usr/bin/w3m -dump -T #{content_type} #{Shellwords.escape filename}` end end diff --git a/lib/sup/message-chunks.rb b/lib/sup/message-chunks.rb index 7a061d9..a8849b0 100644 --- a/lib/sup/message-chunks.rb +++ b/lib/sup/message-chunks.rb @@ -1,4 +1,5 @@ require 'tempfile' +require 'shellwords' ## Here we define all the "chunks" that a message is parsed ## into. Chunks are used by ThreadViewMode to render a message. Chunks @@ -58,6 +59,8 @@ end module Redwood module Chunk class Attachment + ## please see note in write_disk on important usage + ## of quotes to avoid remote command injection HookManager.register "mime-decode", < content_type, + ## please see note in write_disk on important usage + ## of quotes to avoid remote command injection + HookManager.run "mime-decode", :content_type => @content_type, :filename => lambda { write_to_disk }, :charset => encoded_content.charset, :sibling_types => sibling_types @@ -146,11 +163,13 @@ EOS def initial_state; :open end def viewable?; @lines.nil? end def view_default! path + ## please see note in write_disk on important usage + ## of quotes to avoid remote command injection case Config::CONFIG['arch'] when /darwin/ - cmd = "open '#{path}'" + cmd = "open #{path}" else - cmd = "/usr/bin/run-mailcap --action=view '#{@content_type}:#{path}'" + cmd = "/usr/bin/run-mailcap --action=view #{@content_type}:#{path}" end debug "running: #{cmd.inspect}" BufferManager.shell_out(cmd) @@ -158,17 +177,31 @@ EOS end def view! - path = write_to_disk - ret = HookManager.run "mime-view", :content_type => @content_type, - :filename => path - ret || view_default!(path) + ## please see note in write_to_disk on important usage + ## of quotes to avoid remote command injection. + write_to_disk do |file| + + @@view_tempfiles.push file # make sure the tempfile is not garbage collected before sup stops + + ret = HookManager.run "mime-view", :content_type => @content_type, + :filename => file.path + ret || view_default!(file.path) + end end + ## note that the path returned from write_to_disk is + ## Shellwords.escaped and is intended to be used without single + ## or double quotes. the use of either opens sup up for remote + ## code injection through the file name. def write_to_disk - file = Tempfile.new(["sup", @filename.gsub("/", "_") || "sup-attachment"]) - file.print @raw_content - file.close - file.path + begin + file = Tempfile.new(["sup", Shellwords.escape(@filename.gsub("/", "_")) || "sup-attachment"]) + file.print @raw_content + yield file if block_given? + return file.path + ensure + file.close + end end ## used when viewing the attachment as text debian/patches/0002-Fix-support-for-gpgme-2.0.patch0000644000000000000000000001712712244421073016642 0ustar From: Clint Byrum Date: Wed, 16 Nov 2011 23:33:00 -0800 Subject: Fix support for gpgme 2.0 * Add support for gpgme 2.0 and stay backward compatible with 1.0. * Add test suite for lib/sup/crypto.rb. * Update call to current GPGME::Data API. Taken from http://gitorious.org/sup/mainline/merge_requests/12 --- lib/sup/crypto.rb | 41 ++++++++++++++++--- test/test_crypto.rb | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 142 insertions(+), 7 deletions(-) create mode 100755 test/test_crypto.rb diff --git a/lib/sup/crypto.rb b/lib/sup/crypto.rb index bc96f88..4ddcf70 100644 --- a/lib/sup/crypto.rb +++ b/lib/sup/crypto.rb @@ -48,10 +48,17 @@ EOS @gpgme_present = begin begin - GPGME.check_version({:protocol => GPGME::PROTOCOL_OpenPGP}) + begin + GPGME.check_version({:protocol => GPGME::PROTOCOL_OpenPGP}) + rescue TypeError + GPGME.check_version(nil) + end true rescue GPGME::Error false + rescue ArgumentError + # gpgme 2.0.0 raises this due to the hash->string conversion + false end rescue NameError false @@ -65,7 +72,11 @@ EOS # if gpg2 is available, it will start gpg-agent if required if (bin = `which gpg2`.chomp) =~ /\S/ - GPGME.set_engine_info GPGME::PROTOCOL_OpenPGP, bin, nil + if GPGME.respond_to?('set_engine_info') + GPGME.set_engine_info GPGME::PROTOCOL_OpenPGP, bin, nil + else + GPGME.gpgme_set_engine_info GPGME::PROTOCOL_OpenPGP, bin, nil + end else # check if the gpg-options hook uses the passphrase_callback # if it doesn't then check if gpg agent is present @@ -104,7 +115,13 @@ EOS {:operation => "sign", :options => gpg_opts}) || gpg_opts begin - sig = GPGME.detach_sign(format_payload(payload), gpg_opts) + if GPGME.respond_to?('detach_sign') + sig = GPGME.detach_sign(format_payload(payload), gpg_opts) + else + crypto = GPGME::Crypto.new + gpg_opts[:mode] = GPGME::SIG_MODE_DETACH + sig = crypto.sign(format_payload(payload), gpg_opts).read + end rescue GPGME::Error => exc raise Error, gpgme_exc_msg(exc.message) end @@ -137,7 +154,13 @@ EOS recipients = to + [from] begin - cipher = GPGME.encrypt(recipients, format_payload(payload), gpg_opts) + if GPGME.respond_to?('encrypt') + cipher = GPGME.encrypt(recipients, format_payload(payload), gpg_opts) + else + crypto = GPGME::Crypto.new + gpg_opts[:recipients] = recipients + cipher = crypto.encrypt(format_payload(payload), gpg_opts).read + end rescue GPGME::Error => exc raise Error, gpgme_exc_msg(exc.message) end @@ -223,7 +246,7 @@ EOS plain_data = nil else signed_text_data = nil - plain_data = GPGME::Data.empty + plain_data = GPGME::Data.empty! end begin ctx.verify(sig_data, signed_text_data, plain_data) @@ -246,7 +269,11 @@ EOS {:operation => "decrypt", :options => gpg_opts}) || gpg_opts ctx = GPGME::Ctx.new(gpg_opts) cipher_data = GPGME::Data.from_str(format_payload(payload)) - plain_data = GPGME::Data.empty + if GPGME::Data.respond_to?('empty') + plain_data = GPGME::Data.empty + else + plain_data = GPGME::Data.empty! + end begin ctx.decrypt_verify(cipher_data, plain_data) rescue GPGME::Error => exc @@ -314,7 +341,7 @@ private def gpgme_exc_msg msg err_msg = "Exception in GPGME call: #{msg}" - info err_msg + #info err_msg err_msg end diff --git a/test/test_crypto.rb b/test/test_crypto.rb new file mode 100755 index 0000000..c7ec88b --- /dev/null +++ b/test/test_crypto.rb @@ -0,0 +1,108 @@ +#!/usr/bin/ruby + +# tests for sup's crypto libs +# +# Copyright Clint Byrum 2011. All Rights Reserved. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA +# 02110-1301, USA. + +require 'tmpdir' +require 'test/unit' +require 'rmail/message' +require 'rmail/parser' +require 'sup/util' +require 'sup/hook' +require 'sup/contact' +require 'sup/person' +require 'sup/account' +require 'sup/message-chunks' +require 'sup/crypto' +require 'stringio' + +module Redwood + +# These are all singletons +CryptoManager.init +Dir.mktmpdir('sup-test') do|f| + HookManager.init f +end +am = {:default=> {:name => "", :email=>ENV['EMAIL']}} +AccountManager.init am + +class TestCryptoManager < Test::Unit::TestCase + + def setup + @from_email = ENV['EMAIL'] + # Change this or import my public key to make these tests work. + @to_email = 'clint@ubuntu.com' + end + + def teardown + end + + def test_sign + if CryptoManager.have_crypto? then + signed = CryptoManager.sign @from_email,@to_email,"ABCDEFG" + assert_instance_of RMail::Message, signed + assert_equal "ABCDEFG", signed.body[0] + assert signed.body[1].body.length > 0 , "signature length must be > 0" + assert (signed.body[1].body.include? "-----BEGIN PGP SIGNATURE-----") , "Expecting PGP armored data" + end + end + + def test_encrypt + if CryptoManager.have_crypto? then + encrypted = CryptoManager.encrypt @from_email, [@to_email], "ABCDEFG" + assert_instance_of RMail::Message, encrypted + assert (encrypted.body[1].body.include? "-----BEGIN PGP MESSAGE-----") , "Expecting PGP armored data" + end + end + + def test_sign_and_encrypt + if CryptoManager.have_crypto? then + encrypted = CryptoManager.sign_and_encrypt @from_email, [@to_email], "ABCDEFG" + assert_instance_of RMail::Message, encrypted + assert (encrypted.body[1].body.include? "-----BEGIN PGP MESSAGE-----") , "Expecting PGP armored data" + end + end + + def test_decrypt + if CryptoManager.have_crypto? then + encrypted = CryptoManager.encrypt @from_email, [@to_email], "ABCDEFG" + assert_instance_of RMail::Message, encrypted + assert_instance_of String, (encrypted.body[1].body) + decrypted = CryptoManager.decrypt encrypted.body[1], true + assert_instance_of Array, decrypted + assert_instance_of Chunk::CryptoNotice, decrypted[0] + assert_instance_of Chunk::CryptoNotice, decrypted[1] + assert_instance_of RMail::Message, decrypted[2] + assert_equal "ABCDEFG" , decrypted[2].body + end + end + + def test_verify + if CryptoManager.have_crypto? + signed = CryptoManager.sign @from_email, @to_email, "ABCDEFG" + assert_instance_of RMail::Message, signed + assert_instance_of String, (signed.body[1].body) + CryptoManager.verify signed.body[0], signed.body[1], true + CryptoManager.verify signed.body[0], signed.body[1], false + end + end + +end + +end -- debian/patches/0001-Patch-out-all-requires-of-rubygems.patch0000644000000000000000000000651612244421073020727 0ustar From: Per Andersson Date: Mon, 9 Apr 2012 14:11:56 +0200 Subject: Patch out all requires of rubygems. --- bin/sup | 2 +- bin/sup-add | 2 +- bin/sup-cmd | 2 +- bin/sup-config | 2 +- bin/sup-dump | 2 +- bin/sup-import-dump | 2 +- bin/sup-server | 2 +- bin/sup-sync | 2 +- bin/sup-sync-back | 2 +- bin/sup-tweak-labels | 2 +- lib/sup.rb | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/bin/sup b/bin/sup index ad7a0d1..ba67490 100755 --- a/bin/sup +++ b/bin/sup @@ -1,6 +1,6 @@ #!/usr/bin/env ruby -require 'rubygems' +#require 'rubygems' no_ncursesw = false begin diff --git a/bin/sup-add b/bin/sup-add index c77720f..89147b4 100755 --- a/bin/sup-add +++ b/bin/sup-add @@ -1,7 +1,7 @@ #!/usr/bin/env ruby require 'uri' -require 'rubygems' +#require 'rubygems' require 'highline/import' require 'trollop' require "sup"; Redwood::check_library_version_against "git" diff --git a/bin/sup-cmd b/bin/sup-cmd index 8ec5c69..62874f3 100755 --- a/bin/sup-cmd +++ b/bin/sup-cmd @@ -1,5 +1,5 @@ #!/usr/bin/env ruby -require 'rubygems' +#require 'rubygems' require 'trollop' require 'sup' require 'sup/client' diff --git a/bin/sup-config b/bin/sup-config index c4a64a3..9fa5c53 100755 --- a/bin/sup-config +++ b/bin/sup-config @@ -1,6 +1,6 @@ #!/usr/bin/env ruby -require 'rubygems' +#require 'rubygems' require 'highline/import' require 'yaml' require 'trollop' diff --git a/bin/sup-dump b/bin/sup-dump index 4908b18..a163d90 100755 --- a/bin/sup-dump +++ b/bin/sup-dump @@ -1,6 +1,6 @@ #!/usr/bin/env ruby -require 'rubygems' +#require 'rubygems' require 'xapian' require 'trollop' require 'set' diff --git a/bin/sup-import-dump b/bin/sup-import-dump index 91a1721..b1916da 100755 --- a/bin/sup-import-dump +++ b/bin/sup-import-dump @@ -1,7 +1,7 @@ #!/usr/bin/env ruby require 'uri' -require 'rubygems' +#require 'rubygems' require 'trollop' require "sup"; Redwood::check_library_version_against "git" diff --git a/bin/sup-server b/bin/sup-server index aeec37c..9e9dd43 100755 --- a/bin/sup-server +++ b/bin/sup-server @@ -1,5 +1,5 @@ #!/usr/bin/env ruby -require 'rubygems' +#require 'rubygems' require 'trollop' require 'sup' require 'sup/server' diff --git a/bin/sup-sync b/bin/sup-sync index b4d5cba..4df4b78 100755 --- a/bin/sup-sync +++ b/bin/sup-sync @@ -1,7 +1,7 @@ #!/usr/bin/env ruby require 'uri' -require 'rubygems' +#require 'rubygems' require 'trollop' require "sup"; Redwood::check_library_version_against "git" diff --git a/bin/sup-sync-back b/bin/sup-sync-back index 5d84cba..4cc02ea 100755 --- a/bin/sup-sync-back +++ b/bin/sup-sync-back @@ -1,6 +1,6 @@ #!/usr/bin/env ruby -require 'rubygems' +#require 'rubygems' require 'uri' require 'tempfile' require 'trollop' diff --git a/bin/sup-tweak-labels b/bin/sup-tweak-labels index 076c802..e96b977 100755 --- a/bin/sup-tweak-labels +++ b/bin/sup-tweak-labels @@ -1,6 +1,6 @@ #!/usr/bin/env ruby -require 'rubygems' +#require 'rubygems' require 'trollop' require "sup"; Redwood::check_library_version_against "git" diff --git a/lib/sup.rb b/lib/sup.rb index 74d5cde..9a4064d 100644 --- a/lib/sup.rb +++ b/lib/sup.rb @@ -1,4 +1,4 @@ -require 'rubygems' +#require 'rubygems' require 'syck' require 'yaml' require 'zlib' -- debian/patches/0005-Require-iconv-and-locale-instead-of-gettext.patch0000644000000000000000000000076212244421073022462 0ustar From: Per Andersson Date: Mon, 18 Jun 2012 23:58:19 +0200 Subject: Require iconv and locale instead of gettext --- lib/sup.rb | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/lib/sup.rb b/lib/sup.rb index 9a4064d..f03b99e 100644 --- a/lib/sup.rb +++ b/lib/sup.rb @@ -4,7 +4,8 @@ require 'yaml' require 'zlib' require 'thread' require 'fileutils' -require 'gettext' +require 'iconv' +require 'locale' require 'curses' require 'rmail' begin -- debian/patches/0006-Use-RbConfig-instead-of-deprecated-Config.patch0000644000000000000000000000114512244421073021774 0ustar From: Per Andersson Date: Wed, 20 Jun 2012 22:31:20 +0200 Subject: Use RbConfig instead of deprecated Config --- bin/sup | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/bin/sup b/bin/sup index ba67490..6ab45f0 100755 --- a/bin/sup +++ b/bin/sup @@ -117,7 +117,7 @@ end require 'dl/import' module LibC extend DL.const_defined?(:Importer) ? DL::Importer : DL::Importable - setlocale_lib = case Config::CONFIG['arch'] + setlocale_lib = case RbConfig::CONFIG['arch'] when /darwin/; "libc.dylib" when /cygwin/; "cygwin1.dll" else; "libc.so.6" -- debian/patches/series0000644000000000000000000000052612244451631012037 0ustar 0001-Patch-out-all-requires-of-rubygems.patch 0002-Fix-support-for-gpgme-2.0.patch 0003-Update-tests-so-they-all-pass.patch 0004-Avoid-crash-when-maybe-wrapping-text.patch 0005-Require-iconv-and-locale-instead-of-gettext.patch 0006-Use-RbConfig-instead-of-deprecated-Config.patch 0007-Fix-remote-code-injection-when-viewing-attachments.patch debian/changelog0000644000000000000000000001265512244451631011053 0ustar sup-mail (0.12.1+git20120407.aaa852f-1+deb7u1) wheezy-security; urgency=high * Fix remote code injection when viewing attachments, CVE-2013-4478 and CVE-2013-4479 (Closes: #728232) -- Per Andersson Sat, 23 Nov 2013 15:16:09 +0100 sup-mail (0.12.1+git20120407.aaa852f-1) unstable; urgency=low * New maintainer. (Closes: #660509) * New upstream version. - Inline GPG support. (Closes: #526868) * Updated debian/copyright to DEP-5 copyright format. * Comply with gem2deb packaging. - Use dh --buildsystem=ruby --with ruby. - Add XS-Ruby-Versions to debian/control. - Run tests during build. - Patch tests so they all pass. - Add Build-Depends for running all tests. - Build for Ruby 1.9.1. * Bump standards version to 3.9.3, no changes needed. * Use source format 3.0 (quilt). * Remove IMAP-folder support from description. (Closes: #614301) * Depend on ruby-yajl and ruby-eventmachine, required for sup-cmd. (Closes: #627916, #627758) * Recommend ruby-gpgme. (Closes: #626297) * Add man pages for all binaries in /usr/bin. (Closes: #573871) * Include protocol.md in docs. * Not including sup-sync-back with package since it only fails with the message "does not work yet". * Add color scheme examples and mention ~/.sup/colors.yaml in sup-mail(1). (Closes: #556980) * Patch out all requires of rubygems. * Include contrib/colorpicker.rb and devel in examples. * Include zsh completion. * Add watch file. * Add patch for gpgme 2.0 support. * Add patch for avoiding crashes when (maybe) wrapping text, happens when expanding GPG signatures. * Remove deprecated dependency on libnet-ssh-ruby1.8, support for mbox+ssh sources is dropped. * Add unapply-patches to debian/source/local-options. * Change dependencies to packages following new Ruby policy - libhighline-ruby => ruby-highline - liblockfile-ruby => ruby-lockfile - libmime-types-ruby => ruby-mime-types - libncurses-ruby => ruby-ncurses - librmail-ruby1.8 => ruby-rubymail - libtrollop-ruby => ruby-trollop - libxapian-ruby1.8 => libxapian-ruby1.9.1 (Closes: #555515) * Depend on ruby-locale instead of libgettext-ruby1.9.1. - Add patch for requiring iconv and locale instead of gettext. * Add patch for using RbConfig instead of deprecated Config. * Provide virtual package mail-reader. -- Per Andersson Thu, 21 Jun 2012 20:29:15 +0200 sup-mail (0.12.1-1) unstable; urgency=low * New upstream version -- Decklin Foster Thu, 10 Feb 2011 13:10:10 -0500 sup-mail (0.11-2) unstable; urgency=low * Remove stray rubygems requires (Closes: #579703) -- Decklin Foster Sat, 01 May 2010 23:05:05 -0400 sup-mail (0.11-1) unstable; urgency=low * New upstream version -- Decklin Foster Sun, 18 Apr 2010 18:31:56 -0400 sup-mail (0.10.2-1) unstable; urgency=low * New upstream version - Xapian is now the default backend, so it's been promoted to Depends. Ferret is still there in case you have not converted your index, but you should read NEWS.Debian for instructions on doing so. -- Decklin Foster Wed, 27 Jan 2010 18:37:22 -0500 sup-mail (0.9.1-1) unstable; urgency=low * New upstream version * Recommend libxapian-ruby (backend works pretty well now) -- Decklin Foster Wed, 06 Jan 2010 09:29:37 -0500 sup-mail (0.9-1) unstable; urgency=low * New upstream version -- Decklin Foster Mon, 12 Oct 2009 16:47:08 -0400 sup-mail (0.8.1-1) unstable; urgency=low * New upstream version - Numeric labels work (Closes: #518758) -- Decklin Foster Fri, 03 Jul 2009 18:13:47 -0400 sup-mail (0.7-1) unstable; urgency=low * New upstream version - Index locking fixed (Closes: #520070) -- Decklin Foster Sat, 28 Mar 2009 15:27:50 -0400 sup-mail (0.6+20081111-1) unstable; urgency=low * Git snapshot release, from master (which has not changed much recently). Additional fixes of mine merged from next: - Read in X-Foo headers - Don't redirect run-mailcap to /dev/null * Correct manual page symlinks (Closes: #518482) * Fix invocation printed by sup-config (Closes: #518479) * Default to Debian sensible-editor, not vi -- Decklin Foster Sat, 07 Mar 2009 18:16:36 -0500 sup-mail (0.6-3) unstable; urgency=low * Update CONTRIBUTORS from upstream git, and add Sam Roberts to debian/copyright (he is the main author of the included rfc2047.rb, a separate project). -- Decklin Foster Sat, 01 Nov 2008 18:40:50 -0400 sup-mail (0.6-2) unstable; urgency=low * Correct command name in man page; distinguish "Sup" the client in general from "sup-mail" the binary. (Closes: #503142) -- Decklin Foster Thu, 23 Oct 2008 12:47:18 -0400 sup-mail (0.6-1) unstable; urgency=low * New upstream version * Fix bin and man page names to reflect 'sup-mail' package name -- Decklin Foster Mon, 29 Sep 2008 19:06:32 -0400 sup-mail (0.5-2) unstable; urgency=low * Merge upstream fix for respond_to? crash -- Decklin Foster Thu, 26 Jun 2008 23:20:54 -0400 sup-mail (0.5-1) unstable; urgency=low * Initial release (Closes: #450602) -- Decklin Foster Mon, 02 Jun 2008 13:34:24 -0400 debian/rules0000755000000000000000000000145412244346643010262 0ustar #!/usr/bin/make -f #export DH_VERBOSE=1 # # Uncomment to ignore all test failures (but the tests will run anyway) #export DH_RUBY_IGNORE_TESTS=all # # Uncomment to ignore some test failures (but the tests will run anyway). # Valid values: #export DH_RUBY_IGNORE_TESTS=ruby1.8 ruby1.9.1 require-rubygems # # If you need to specify the .gemspec (eg there is more than one) #export DH_RUBY_GEMSPEC=gem.gemspec %: dh $@ --buildsystem=ruby --with ruby override_dh_install: dh_install # rename sup binary to sup-mail mv debian/sup-mail/usr/bin/sup debian/sup-mail/usr/bin/sup-mail # remove sup-sync-back since it does not work yet rm -f debian/sup-mail/usr/bin/sup-sync-back # install zsh completion install -m 0644 -D contrib/completion/_sup.zsh debian/sup-mail/usr/share/zsh/functions/Completion/Unix/_sup debian/NEWS0000644000000000000000000000263012244451631007670 0ustar sup-mail (0.12.1+git20120407.aaa852f-1+deb7u1) wheezy-security; urgency=high It was discovered that Sup was vulnerable to a remote code injection exploit triggered by specially crafted mail attachment content-type or filename. A fix has been backported from 0.13.2.1 to remedy the vulnerability. Full disclosure is available: CVE-2013-4478 and CVE-2013-4479. Review any user defined mailcap entries, mime-decode and mime-view hooks with respect this vulnerability. More information is available in /usr/share/doc/sup-mail/FAQ.txt.gz and also on the Sup wiki page for viewing attachments https://github.com/sup-heliotrope/sup/wiki/Viewing-Attachments -- Per Andersson Sun, 24 Nov 2013 03:27:43 +0100 sup-mail (0.11-1) unstable; urgency=low IMAP, IMAPS, and mbox+ssh sources have been deprecated and will be removed in 0.12. You should use a program such as fetchmail or getmail to download your mail to a local Maildir or mbox. -- Decklin Foster Sun, 18 Apr 2010 18:33:24 -0400 sup-mail (0.10.2-1) unstable; urgency=low The default backend for Sup's index has been changed from Ferret to Xapian. In 0.11, support for Ferret will be removed, so you should convert your index now. To do so, run `sup-convert-ferret-index' (this will take some time, so be patient). -- Decklin Foster Wed, 27 Jan 2010 22:12:33 -0500 debian/watch0000644000000000000000000000020312244451631010214 0ustar version=3 opts=filenamemangle=s/.*=(.*)/sup-mail-$1\.tar\.gz/ \ http://gitorious.org/sup/mainline/archive-tarball/release-(.*) debian/source/0000755000000000000000000000000012244346643010476 5ustar debian/source/format0000644000000000000000000000001412244346643011704 0ustar 3.0 (quilt) debian/sup-mail.examples0000644000000000000000000000005312244346643012463 0ustar contrib/colorpicker.rb debian/themes devel debian/man/0000755000000000000000000000000012244421073007740 5ustar debian/man/sup-import-dump.10000644000000000000000000000266412244346643013125 0ustar .TH SUP-IMPORT-DUMP "1" "April 9, 2012" .SH NAME sup-import-dump \- import message state dump to Sup index .SH SYNOPSIS .B sup-import-dump .RI [ options ] dumpfile .SH DESCRIPTION Imports message state previously exported by sup\-dump into the index. sup\-import\-dump operates on the index only, so the messages must have already been added using sup\-sync. If you need to recreate the index, see sup\-sync \fB\-\-restore\fR instead. .PP Messages not mentioned in the dump file will not be modified. .SH OPTIONS .TP \fB\-\-verbose\fR, \fB\-v\fR Print message ids as they're processed .TP \fB\-\-ignore\-missing\fR, \fB\-i\fR Silently skip over messages that are not in the index .TP \fB\-\-warn\-missing\fR, \fB\-w\fR Warn about messages that are not in the index, but continue .TP \fB\-\-abort\-missing\fR, \fB\-a\fR Abort on encountering messages that are not in the index (default) .TP \fB\-\-atomic\fR, \fB\-t\fR Use transaction to apply all changes atomically .TP \fB\-\-dry\-run\fR, \fB\-n\fR Don't actually modify the index. Probably only useful with \fB\-\-verbose\fR .TP \fB\-\-version\fR Show version information .TP \fB\-\-help\fR, \fB\-h\fR Show help message .SH SEE ALSO sup-mail(1), sup-sync(1), sup-dump(1) .SH AUTHOR Sup was written by William Morgan . .PP This manual page was written by Per Andersson for the Debian project (but may be used by others). \# vim: ft=groff tw=80 debian/man/sup-cmd.10000644000000000000000000000217512244421073011377 0ustar .TH SUP-CMD "1" "April 9, 2012" .SH NAME sup-cmd \- connect to a running sup-server .SH SYNOPSIS .B sup-cmd [\fIglobal options\fR] command .RI [ options ] .SH DESCRIPTION Connect to a running sup-server and execute command. .PP Valid commands are: .IP query count label add .SH OPTIONS .TP \fB\-\-archive\fR, \fB\-a\fR Automatically archive all new messages from these sources. .TP \fB\-\-unusual\fR, \fB\-u\fR Do not automatically poll these sources for new messages. .TP \fB\-\-labels\fR, \fB\-l\fR label A comma\-separated set of labels to apply to all messages from this source .TP \fB\-\-force\-new\fR, \fB\-f\fR Create a new account for this source, even if one already exists. .TP \fB\-\-force\-account\fR, \fB\-o\fR account Reuse previously defined account user@hostname .TP \fB\-\-version\fR, \fB\-v\fR Print version and exit .TP \fB\-\-help\fR, \fB\-h\fR Show help message .SH SEE ALSO sup-mail(1), sup-server(1) .SH AUTHOR Sup was written by William Morgan . .PP This manual page was written by Per Andersson for the Debian project (but may be used by others). \# vim: ft=groff tw=80 debian/man/sup-sync.10000644000000000000000000000474712244346643011630 0ustar .TH SUP-SYNC "1" "April 9, 2012" .SH NAME sup-sync \- sychronize the Sup index with message sources .SH SYNOPSIS .B sup-sync .RI [ options ] source ... .SH DESCRIPTION Synchronizes the Sup index with one or more message sources by adding messages, deleting messages, or changing message state in the index as appropriate. .PP "Message state" means read/unread, archived/inbox, starred/unstarred, and all user\-defined labels on each message. .PP "Default source state" refers to any state that a source itself has keeps about a message. Sup\-sync uses this information when adding a new message to the index. The source state is typically limited to read/unread, archived/inbox status and a single label based on the source name. Messages using the default source state are placed in the inbox (i.e. not archived) and unstarred. .PP If no sources are given, sync from all usual sources. Supported source URI schemes can be seen by running "sup\-add \fB\-\-help\fR". .SH MESSAGE STATE OPTIONS .TP \fB\-\-asis\fR If the message is already in the index, preserve its state. Otherwise, use default source state (default) .TP \fB\-\-restore\fR dumpfile Restore message state from a dump file created with sup\-dump. If a message is not in this dumpfile, act as \fB\-\-asis\fR .TP \fB\-\-discard\fR Discard any message state in the index and use the default source state. Dangerous! .TP \fB\-\-archive\fR, \fB\-x\fR When using the default source state, mark messages as archived. .TP \fB\-\-read\fR, \fB\-r\fR When using the default source state, mark messages as read. .TP \fB\-\-extra\-labels\fR labels When using the default source state, also apply these user\-defined labels (a comma\-separated list) (default) .SH OTHER OPTIONS .TP \fB\-\-verbose\fR, \fB\-v\fR Print message ids as they're processed. .TP \fB\-\-optimize\fR, \fB\-o\fR As the final operation, optimize the index. .TP \fB\-\-all\-sources\fR Scan over all sources. .TP \fB\-\-dry\-run\fR, \fB\-n\fR Don't actually modify the index. Probably only useful with \fB\-\-verbose\fR. .TP \fB\-\-version\fR Show version information .TP \fB\-\-help\fR, \fB\-h\fR Show help message .SH FILES .TP 30 .I $HOME/.sup/sources.yaml Configuration file for Sup mail sources .SH SEE ALSO sup-mail(1), sup-add(1), sup-config(1), sup-dump(1), sup-tweak-labels(1) .SH AUTHOR Sup was written by William Morgan . .PP This manual page was written by Per Andersson for the Debian project (but may be used by others). \# vim: ft=groff tw=80 debian/man/sup-dump.10000644000000000000000000000172212244346643011607 0ustar .TH SUP-DUMP "1" "April 9, 2012" .SH NAME sup-dump \- dumps message state from Sup index .SH SYNOPSIS .B sup-dump .RI [ options ] .SH DESCRIPTION Dumps all message state from the Sup index to standard out. You can later use sup\-sync \fB\-\-restored\fR \fB\-\-restore\fR to recover the index. .PP This tool is primarily useful in the event that a Sup upgrade breaks index format compatibility. .SH OPTIONS .TP \fB\-\-version\fR, \fB\-v\fR Print version and exit .TP \fB\-\-help\fR, \fB\-h\fR Show help message .SH EXAMPLES Dump message state and store in file .IP sup\-dump > filename .TP Dump message state and compress output to store in file .IP sup\-dump | bzip2 > filename.bz2 .SH SEE ALSO sup-mail(1), sup-sync(1), sup-import-dump(1) .SH AUTHOR Sup was written by William Morgan . .PP This manual page was written by Per Andersson for the Debian project (but may be used by others). \# vim: ft=groff tw=80 debian/man/sup-tweak-labels.10000644000000000000000000000263212244346643013216 0ustar .TH SUP-TWEAK-LABELS "1" "April 9, 2012" .SH NAME sup-tweak-labels \- batch modification of message state already in index .SH SYNOPSIS .B sup-tweak-labels .RI [ options ] source ... .SH DESCRIPTION Batch modification of message state for messages already in the index. .PP Supported source URI schemes can be seen by running "sup\-add \fB\-\-help\fR". .SH OPTIONS .TP \fB\-\-add\fR, \fB\-a\fR labels One or more labels (comma\-separated) to add to every message from the specified sources (default: ) .TP \fB\-\-remove\fR, \fB\-r\fR labels One or more labels (comma\-separated) to remove from every message from the specified sources, if those labels are present (default: ) .TP \fB\-\-query\fR, \fB\-q\fR query A Sup search query .SH OTHER OPTIONS .TP \fB\-\-verbose\fR, \fB\-v\fR Print message ids as they're processed .TP \fB\-\-very\-verbose\fR, \fB\-e\fR Print message names and subjects as they're processed .TP \fB\-\-all\-sources\fR Scan over all sources .TP \fB\-\-dry\-run\fR, \fB\-n\fR Don't actually modify the index. Probably only useful with \fB\-\-verbose\fR .TP \fB\-\-version\fR Show version information .TP \fB\-\-help\fR, \fB\-h\fR Show help message .SH SEE ALSO sup-mail(1), sup-add(1) .SH AUTHOR Sup was written by William Morgan . .PP This manual page was written by Per Andersson for the Debian project (but may be used by others). \# vim: ft=groff tw=80 debian/man/sup-config.10000644000000000000000000000136512244346643012112 0ustar .TH SUP-CONFIG "1" "April 2012" .SH NAME sup-config \- interactive configuration tool for Sup .SH SYNOPSIS .B sup-config .RI [ options ] .SH DESCRIPTION Interactive configuration tool for Sup. Won't destroy existing configuration. .SH OPTIONS .TP \fB\-\-version\fR, \fB\-v\fR: Print version and exit .TP \fB\-\-help\fR, \fB\-h\fR: Show help message .SH FILES .TP 30 .I $HOME/.sup/config.yaml Configuration file for Sup .TP 30 .I $HOME/.sup/sources.yaml Configuration file for Sup mail sources .SH SEE ALSO sup-mail(1), sup-add(1) .SH AUTHOR Sup was written by William Morgan . .PP This manual page was written by Per Andersson for the Debian project (but may be used by others). \# vim: ft=groff tw=80 debian/man/sup-server.10000644000000000000000000000136312244421073012140 0ustar .TH SUP-SERVER "1" "April 9, 2012" .SH NAME sup-server \- interact with a Sup index .SH SYNOPSIS .B sup-server .RI [ options ] .SH DESCRIPTION Start a server with which one can interact with a Sup index. .SH OPTIONS .TP \fB\-\-host\fR, \fB\-o\fR address Address to listen on (default: localhost) .TP \fB\-\-port\fR, \fB\-p\fR Port to listen on (default: 4300) .TP \fB\-\-verbose\fR, \fB\-v\fR Be verbose .TP \fB\-\-help\fR, \fB\-h\fR Show help message .SH SEE ALSO sup-mail(1), sup-cmd(1) .PP /usr/share/doc/sup-mail/protocol.md .SH AUTHOR Sup was written by William Morgan . .PP This manual page was written by Per Andersson for the Debian project (but may be used by others). \# vim: ft=groff tw=80 debian/man/sup-mail.10000644000000000000000000000301712244346643011563 0ustar .TH "SUP" 1 .SH NAME sup-mail \- Sup, a thread-centric mailer with tagging and fast search .SH SYNOPSIS .B sup-mail .RI [ options ] .SH DESCRIPTION This manual page documents briefly the .B sup-mail command. .PP .B Sup is a console-based email client. The command .B sup-mail invokes the interactive curses frontend. Several other commands are used to configure Sup and add mail sources; please refer to the "New User's Guide" for details. .SH OPTIONS .TP .B \-\-list\-hooks, \-l List all hooks and descriptions, and quit .TP .B \-\-no\-threads, \-n Turn off threading. Helps with debugging. (Necessarily disables background polling for new messages.) .TP .B \-\-no\-initial\-poll, \-o Don't poll for new messages when starting .TP .B \-\-search, \-s query Search for this query upon startup .TP .B \-\-compose, \-c recipient Compose message to this recipient upon startup .TP .B \-\-version, \-v Show version of program .TP .B \-\-help, \-h Show summary of options .SH FILES .TP 30 $HOME/.sup/colors.yaml Color theme for Sup, see .I /usr/share/doc/sup-mail/examples for example themes .SH SEE ALSO mail(1), sup-add(1), sup-cmd(1), sup-config(1), sup-dump(1), sup-import-dump(1), sup-recover-sources(1), sup-server(1), sup-sync(1), sup-sync-back(1), sup-tweak-labels(1) .PP .I /usr/share/doc/sup-mail/NewUserGuide.txt.gz .SH AUTHOR Sup was written by William Morgan . .PP This manual page was written by Decklin Foster for the Debian project (but may be used by others). \# vim: ft=groff tw=80 debian/man/sup-add.10000644000000000000000000000260012244346643011366 0ustar .TH SUP-ADD "1" "April 9, 2012" .SH NAME sup-add \- add a source to the Sup source list .SH SYNOPSIS .B sup-add .RI [ options ] [\fIsource uri\fR\&\.\.\.] .SH DESCRIPTION Add one ore more sources to the Sup source list .PP For mbox files on local disk, use the form: .IP mbox:, or mbox:// .PP For Maildir folders, use the form: .IP maildir:; or maildir:// .SH OPTIONS .TP \fB\-\-archive\fR, \fB\-a\fR Automatically archive all new messages from thesesources. .TP \fB\-\-unusual\fR, \fB\-u\fR Do not automatically poll these sources for new messages. .TP \fB\-\-labels\fR, \fB\-l\fR label A comma\-separated set of labels to apply to all messages from this source .TP \fB\-\-force\-new\fR, \fB\-f\fR Create a new account for this source, even if one already exists .TP \fB\-\-force\-account\fR, \fB\-o\fR account Reuse previously defined account user@hostname .TP \fB\-\-version\fR, \fB\-v\fR Print version and exit .TP \fB\-\-help\fR, \fB\-h\fR Show help message .SH FILES .TP 30 .I $HOME/.sup/sources.yaml Configuration file for Sup mail sources .SH SEE ALSO sup-mail(1), sup-config(1) .SH AUTHOR Sup was written by William Morgan . .PP This manual page was written by Per Andersson for the Debian project (but may be used by others). \# vim: ft=groff tw=80 debian/man/sup-recover-sources.10000644000000000000000000000322412244346643013767 0ustar .TH SUP-RECOVER-SOURCES "1" "April 9, 2012" .SH NAME sup-recover-sources \- rebuild a lost Sup source configuration file .SH SYNOPSIS .B sup-recover-sources .RI [ options ] [\fIsource uri\fR\&\.\.\.] .SH DESCRIPTION Rebuilds a lost sources.yaml file by reading messages from a list of sources and determining, for each source, the most prevalent 'source_id' field of messages from that source in the index. The only non-deterministic component to this is that if the same message appears in multiple sources, those sources may be mis-diagnosed by this program. If the first N messages (\-\-scan-num below) all have the same source_id in the index, the source will be added to sources.yaml. Otherwise, the distribution will be printed, and you will have to add it by hand. The offset pointer into the sources will be set to the end of the source, so you will have to run sup-import \-\-rebuild for each new source after doing this. .SH OPTIONS .TP \fB\-\-unusual\fR Mark sources as 'unusual'. Only usual sources will be polled by hand (default: false) .TP \fB\-\-archive\fR Mark sources as 'archive'. New messages from these sources will not appear in the inbox (default: false) .TP \fB\-\-scan-num\fR N Number of messages to scan per source (default: 10) .TP \fB\-h\fR, \fB\-\-help\fR Show help message .SH FILES .TP 30 .I $HOME/.sup/sources.yaml Configuration file for Sup mail sources .SH SEE ALSO sup-mail(1), sup-config(1), sup-add(1), sup-import(1) .SH AUTHOR Sup was written by William Morgan . .PP This manual page was written by Per Andersson for the Debian project (but may be used by others). \# vim: ft=groff tw=80 debian/compat0000644000000000000000000000000212244346643010374 0ustar 7 debian/sup-mail.docs0000644000000000000000000000005212244421073011563 0ustar doc/* protocol.md README.txt ReleaseNotes