sup 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of sup might be problematic. Click here for more details.

@@ -1,3 +1,6 @@
1
+ == 0.0.6 / 2007-01-06
2
+ * Very minor fix to support more types of IMAP authentication.
3
+
1
4
  == 0.0.5 / 2007-01-05
2
5
 
3
6
  * More bugfixes, primarily for IMAP.
@@ -1,12 +1,10 @@
1
1
  Sup FAQ
2
2
  -------
3
3
  Q: What does Sup stand for?
4
-
5
4
  A: It stands for "what's up?", which is more or less the question I'm
6
5
  asking when I read my mail.
7
6
 
8
7
  Q: If you love GMail so much, why not just use it?
9
-
10
8
  A: I hate using a mouse, and I hate ads, and I hate non-programmability
11
9
  and non-extensibility.
12
10
 
@@ -1,6 +1,6 @@
1
1
  Should an email client have a philosophy? I think so. For many people,
2
- email is our primary means of communication. Something so important
3
- ought to warrant a little thought.
2
+ email is one of our primary means of communication. Something so
3
+ important ought to warrant a little thought.
4
4
 
5
5
  So here's Sup's philosophy.
6
6
 
@@ -9,38 +9,42 @@ Anyone who's on a high-traffic mailing list knows this. My ruby-talk
9
9
  folder is 350 megs and Mutt sits there for 60 seconds while it opens
10
10
  it. Keeping up with the all the new traffic is painful, even with
11
11
  Mutt's excellent threading features, simply because there's so much of
12
- it---a single thread can span several pages, and God help you if you
13
- lag behind. And Mutt is probably the best email client out there in
14
- terms of threading and mailing list support. God help me if I try and
15
- throw Thunderbird at that.
12
+ it. A single thread can span several pages in the folder index view
13
+ alone! And Mutt is probably the fastest email client out there, and
14
+ the most featureful and in terms of threading and mailing list
15
+ support. God help me if I try and throw Thunderbird at that.
16
16
 
17
17
  The principle problem with traditional clients is that they deal with
18
- individual pieces of email, and place a high mental cost on the user
18
+ individual pieces of email. This places a high mental cost on the user
19
19
  for each incoming email, by forcing them to ask: Should I keep this
20
- email, or delete it? If I keep it, where should I file it?
20
+ email, or delete it? If I keep it, where should I file it?
21
+ For example, I've spent the last 10 years of my life laboriously
22
+ hand-filing every email message I received and feeling a mild sense of
23
+ panic every time an email was both "from Mom" and "about school". The
24
+ massive amounts of email that many people receive, and the cheap cost
25
+ of storage, have made these questions both more costly and less useful
26
+ to answer.
21
27
 
22
- I've spent the last 10 years of my life laboriously hand-filing every
23
- email message I received and feeling a mild sense of panic every time
24
- an email was both "from Mom" and "about school". The massive amounts
25
- of email that many people receive, and the cheap cost of storage, have
26
- made these questions both more costly and less useful to answer.
28
+ I think GMail has taken the right approach. As a long-time Mutt user,
29
+ I was blown away when I first saw people use GMail, because I saw them
30
+ treat their email differently from how I had ever treated mine. I saw
31
+ that making certain operations quantitatively easier (namely, search)
32
+ resulted in a qualitative difference in usage. Uou didn't have to
33
+ worry about filing things into folders correctly, because you could
34
+ just find things later by searching for them. I also saw that
35
+ thread-centrism had many advantages over message-centrism when message
36
+ volume was high.
27
37
 
28
- As a long-time Mutt user, when I first watched people use GMail, I saw
29
- them use email differently from how I had ever used it. I saw that
30
- making certain operations quantitatively easier (namely, search)
31
- resulted in a qualitative difference in usage: you don't have to worry
32
- about filing correctly, because you can always find things later by
33
- search. And I saw that thread-centrism had many advantages over
34
- message-centrism when message volume was high.
38
+ Much of the inspiration for Sup was based on GMail. I think it's to
39
+ the GMail designers' credit that they started with a somewhat ad-hoc
40
+ idea (hey, we're really good at search engines, so maybe we can build
41
+ an email client on top of one) and managed to build something that was
42
+ actually better than everything else out there. At least, that's how I
43
+ imagine in happened. Maybe they knew what they were doing from the
44
+ start.
35
45
 
36
- So, in many ways, I believe GMail has taken the right approach to
37
- handle both of the factors above, and much of the inspiration for Sup
38
- was based on GMail. I think it's to the GMail designers' credit that
39
- they started with a somewhat ad-hoc idea (hey, we're really good at
40
- search engines, so can we build an email client on top of one?) and
41
- managed to build something that was actually better than everything
42
- else out there. But ultimately, GMail wasn't right for me (see FAQ),
43
- which is why the idea for Sup was born.
46
+ But ultimately, GMail wasn't right for me, which is why the idea for
47
+ Sup was born.
44
48
 
45
49
  Sup is based on the following principles, which I more or less stole
46
50
  directly from GMail:
@@ -49,8 +53,7 @@ directly from GMail:
49
53
  entire email archive eliminates most of the need for folders,
50
54
  and eliminates the necessity of having to ever delete email.
51
55
 
52
- - Labels eliminate what little need for folders that search doesn't
53
- eliminate.
56
+ - Labels eliminate what little need for folders search doesn't cover.
54
57
 
55
58
  - A thread-centric approach to the UI is much more in line with how
56
59
  people operate than dealing with individual messages is. In the vast
@@ -60,6 +63,6 @@ directly from GMail:
60
63
  Sup is also based on many ideas from mutt and Emacs and vi, having to
61
64
  do with the fantastic productivity of a console- and keyboard-based
62
65
  application, the usefulness of multiple buffers, the necessity of
63
- handling multiple email accounts, etc.
66
+ handling multiple email accounts, etc. But those are just details!
64
67
 
65
- Give it a go and let me know what you think.
68
+ So give it a go and let me know what you think.
data/doc/TODO CHANGED
@@ -1,4 +1,6 @@
1
+ fix bug: when returning from a shelling out, ncurses is crazy
1
2
  batch deletion
3
+ maildir
2
4
  on startup, multi-threadedly call #connect on all sources
3
5
  support for message-content modules such as ruby-talk:XXXXX detection
4
6
  use Net::SMTP
@@ -18,6 +20,7 @@ pop
18
20
  move sup-import argument handling to getopt
19
21
  be able to mark individual messages as spam in thread-view-mode
20
22
 
23
+ x fix bug: envelope-to thing still not working
21
24
  x fix snippet repetitions with small snippets
22
25
  x fix next and previous in thread-view-mode with <unreceived messages>
23
26
  x move sup-import username/password prompts to highline
@@ -73,9 +73,9 @@ Search and labels are an integral part of Sup because in Sup, rather
73
73
  than viewing the contents of a folder, you view the results of a
74
74
  search. I mentioned above that your inbox is, by definition, the set
75
75
  of all messages that aren't archived. This means that your inbox is,
76
- in fact, the result of the search for "all messages without the label
77
- 'archive'". It's actually slightly more complicated---we omit killed,
78
- deleted and spam messages as well.
76
+ in fact, the result of the search for all messages with the label
77
+ "inbox". (It's actually slightly more complicated---we omit killed,
78
+ deleted and spam messages as well.)
79
79
 
80
80
  So you could replicate the folder paradigm easily under this scheme,
81
81
  by giving each message exactly one label and only viewing the results
data/lib/sup.rb CHANGED
@@ -13,7 +13,7 @@ class Object
13
13
  end
14
14
 
15
15
  module Redwood
16
- VERSION = "0.0.5"
16
+ VERSION = "0.0.6"
17
17
 
18
18
  BASE_DIR = ENV["SUP_BASE"] || File.join(ENV["HOME"], ".sup")
19
19
  CONFIG_FN = File.join(BASE_DIR, "config.yaml")
@@ -112,7 +112,21 @@ class IMAP < Source
112
112
  #raise Net::IMAP::ByeResponseError, "simulated imap failure"
113
113
  @imap = Net::IMAP.new host, port, ssl?
114
114
  say "Logging in..."
115
- @imap.authenticate 'LOGIN', @username, @password
115
+
116
+ ## although RFC1730 claims that "If an AUTHENTICATE command
117
+ ## fails with a NO response, the client may try another", in
118
+ ## practice it seems like they will also send BAD responses.
119
+ begin
120
+ @imap.authenticate 'CRAM-MD5', @username, @password
121
+ rescue Net::IMAP::BadResponseError, Net::IMAP::NoResponseError => e
122
+ Redwood::log "CRAM-MD5 authentication failed: #{e.class}. Trying LOGIN auth..."
123
+ begin
124
+ @imap.authenticate 'LOGIN', @username, @password
125
+ rescue Net::IMAP::BadResponseError, Net::IMAP::NoResponseError => e
126
+ Redwood::log "LOGIN authentication failed: #{e.class}. Trying plain-text LOGIN..."
127
+ @imap.login @username, @password
128
+ end
129
+ end
116
130
  scan_mailbox
117
131
  say "Successfully connected to #{@parsed_uri}."
118
132
  rescue SocketError, Net::IMAP::Error, SourceError => e
@@ -190,7 +204,7 @@ private
190
204
  message =
191
205
  case e
192
206
  when Exception
193
- "Error while #{opts[:while]}: #{e.message.chomp}."
207
+ "Error while #{opts[:while]}: #{e.message.chomp} (#{e.class.name})."
194
208
  when String
195
209
  e
196
210
  end
@@ -199,7 +213,7 @@ private
199
213
 
200
214
  self.broken_msg = message
201
215
  Redwood::log message
202
- BufferManager.flash "Error communicating with IMAP server. See log for details."
216
+ BufferManager.flash "Error communicating with IMAP server. See log for details." if BufferManager.instantiated?
203
217
  raise SourceError, message
204
218
  end
205
219
 
@@ -106,7 +106,7 @@ class Loader < Source
106
106
  @f.gets # now we're at a BREAK_RE, so skip past it
107
107
  else # case 2
108
108
  returned_offset = cur_offset
109
- ## we've already skipped past the BREAK_RE, to just go
109
+ ## we've already skipped past the BREAK_RE, so just go
110
110
  end
111
111
 
112
112
  while(line = @f.gets)
@@ -3,26 +3,48 @@ module Redwood
3
3
  class SourceError < StandardError; end
4
4
 
5
5
  class Source
6
- ## dirty? described whether cur_offset has changed, which means the
7
- ## source needs to be re-saved to disk.
6
+ ## Implementing a new source is typically quite easy, because Sup
7
+ ## only needs to be able to:
8
+ ## 1. See how many messages it contains
9
+ ## 2. Get an arbirtrary message
10
+ ## 3. (optional) see whether the source has marked it read or not
8
11
  ##
9
- ## broken? means no message can be loaded, e.g. IMAP server is
10
- ## down, mbox file is corrupt and needs to be rescanned.
11
-
12
- ## When writing a new source, you should implement:
12
+ ## In particular, Sup doesn't need to move messages, mark them as
13
+ ## read, delete them, or anything else. (Well, maybe delete at some
14
+ ## point.)
13
15
  ##
14
- ## start_offset
15
- ## end_offset
16
- ## load_header(offset)
17
- ## load_message(offset)
18
- ## raw_header(offset)
19
- ## raw_full_message(offset)
20
- ## next (or each, if you prefer)
21
-
22
- ## you can throw SourceErrors from any of those, but we don't catch
23
- ## anything else, so make sure you catch all non-fatal errors and
24
- ## reraise them as source errors.
16
+ ## On the other hand, Sup assumes that you can assign each message a
17
+ ## unique integer id, such that newer messages have higher ids than
18
+ ## earlier ones, and that those ids stay constant across sessions
19
+ ## (in the absence of some other client going in and fucking
20
+ ## everything up). For example, for mboxes I use the file offset of
21
+ ## the start of the message. If a source does NOT have that
22
+ ## capability, e.g. IMAP, then you have to do a little more work to
23
+ ## simulate it.
24
+ ##
25
+ ## To write a new source, subclass this class, and should implement:
26
+ ##
27
+ ## - start_offset
28
+ ## - end_offset
29
+ ## - load_header offset
30
+ ## - load_message offset
31
+ ## - raw_header offset
32
+ ## - raw_full_message offset-
33
+ ## - next (or each, if you prefer)
34
+ ##
35
+ ## You can throw SourceErrors from any of those, but we don't catch
36
+ ## anything else, so make sure you catch *all* errors and reraise
37
+ ## them as SourceErrors, and set broken_msg to something if the
38
+ ## source needs to be rescanned.
39
+ ##
40
+ ## Also, be sure to make the source thread-safe, since it WILL be
41
+ ## pummeled from multiple threads at once.
25
42
 
43
+ ## dirty? described whether cur_offset has changed, which means the
44
+ ## source info needs to be re-saved to sources.yaml.
45
+ ##
46
+ ## broken? means no message can be loaded, e.g. IMAP server is
47
+ ## down, mbox file is corrupt and needs to be rescanned, etc.
26
48
  bool_reader :usual, :archived, :dirty
27
49
  attr_reader :uri, :cur_offset, :broken_msg
28
50
  attr_accessor :id
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: sup
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.0.5
7
- date: 2007-01-05 00:00:00 -08:00
6
+ version: 0.0.6
7
+ date: 2007-01-06 00:00:00 -08:00
8
8
  summary: 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.
9
9
  require_paths:
10
10
  - lib