William Morgan [Wed, 24 Jun 2009 17:30:43 +0000 (13:30 -0400)]
bugfix: dates need to be truncated for xapian to index
If dates are way out of range, the current indexing process both dies
and generates bad doc ids. This patch forces dates to be within a
reasonable range (current between 1969 and 2038.) Not necessarily the
best solution.
William Morgan [Wed, 24 Jun 2009 13:10:19 +0000 (09:10 -0400)]
explicitly load index version, for better error messages
Catching the LoadError was masking errors from not having dependent
library like xapian and gdbm. This change makes the error messages
reflect what's actually missing. Since we're adding index types at
roughly once every 3 years, an explicit list like this shouldn't be too
difficult to maintain.
Rich Lane [Wed, 17 Jun 2009 00:24:59 +0000 (17:24 -0700)]
index: consistent naming
Replaced use of run_query with each_docid
Rename instances of ferret query objects to 'ferret_query'
Rename 'build_query' to 'build_ferret_query'
Rename hashes passed to index methods to 'query'
Rename 'parse_user_query_string' to 'parse_query'
Change 'parse_query' to return a query hash
Rename 'drop_entry' to 'delete' and modify callers to pass msgid
Rich Lane [Wed, 17 Jun 2009 00:24:58 +0000 (17:24 -0700)]
index: cleanup interface
Added the public methods 'each_docid', 'each_message', and 'optimize' to the
index. Removed the 'index' and 'ferret' accessors and modified their callers to
use the new methods. Bonus fixes: sup-dump no longer skips the first message
and sup_sync --start_at can now delete unseen messages.
Rich Lane [Fri, 12 Jun 2009 19:35:52 +0000 (12:35 -0700)]
fixes for ruby1.9
Change colons in case statements to 'then'
Fix a block that didn't take enough arguments
Rename variables to avoid shadowing warnings
Use String.ord (and define it for 1.8)
Use DL::Importer on 1.9
Make require 'fastthread' optional
Copy in RE_UTF8
Ben Walton [Sun, 7 Jun 2009 23:44:37 +0000 (19:44 -0400)]
Bounce Message Hook
Determine the command used to bounce a message based on a Hook instead
of a configuration option. Instead of writing an external script that
can send the message properly based on the recipient addresses, rely
on a hook that can return the command based on the From header in the
mail being bounced as well as the intended recipients. This is more
in line with the sup philosophy.
The default is still to strip any -t from the sendmail command of the
default account.
Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
Ben Walton [Sun, 7 Jun 2009 16:38:41 +0000 (12:38 -0400)]
Add message bouncing capability
Bouncing a message is akin to redirecting a mail with a .forward
entry. It is passed back to the mail system as it sits on disk.
By pressing ! while viewing a message, you can now re-inject it to the
mail system using either the command defined in bounce_sendmail or the
sendmail command for the default account with any instance of -t
removed. The user is prompted for the recipients of the message and is
offered a chance to confirm the bounce before it is sent.
The message is _not_ stored in the sent box, as this doesn't make
sense with bounced messages (and would not show up uniquely anyway).
The bounce_sendmail configuration item allows users that require
different sendmail commands depending on where the bounce is destined
to write a wrapper around their local mail tools to pick and choose
the appropriate injection method for the message based on the
addresses passed in. Most systems can likely use: sendmail -oem -i
Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
William Morgan [Fri, 5 Jun 2009 03:32:28 +0000 (23:32 -0400)]
make enter collapse current message in thread-view-mode
Pressing enter while over a text region in thread-view-mode will now
collapse the current message and move the cursor to the next open
message. (Behavior on quoted regions, sigs, attachments, etc. is
unchanged.)
This means that you can scan through a thread pretty rapidly by pressing
enter if you want to collapse the current message, or 'n' if you want
to keep it open.
William Morgan [Tue, 2 Jun 2009 14:39:18 +0000 (07:39 -0700)]
refactor iconv stuff, and normalize message body and headers
- Message body and headers are now normalized to the current encoding.
This should limit the amount of unprintable characters on the screen.
- No more MessageFormatError (was never being thrown anyways).
- Move exception handling to Iconv.easy_decode
- No more Message#convert_from, since Iconv.easy_decode does it all now.
Ben Walton [Thu, 7 May 2009 21:46:51 +0000 (17:46 -0400)]
Sent label handling change
Make PollManager add the 'sent' label if the source it's collecting
messages from is the configured sent source. Remove the sent label
from SentLoader, which makes it even less 'special.'
Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
Ben Walton [Thu, 7 May 2009 21:23:50 +0000 (17:23 -0400)]
sup-config: add awareness of non-default sent source
The user is now prompted to select a source to store sent mail in.
Only sources that are capable of storing mail are presented. The
default sup://sent is available as an option too.
Ben Walton [Thu, 7 May 2009 02:44:24 +0000 (22:44 -0400)]
SentManager: rework handling to allow for user specified source
* The handling of SentManager now allows for a parameter in config.yaml
called sent_source. This parameter should be the URI of the source
that the users wishes to store outbound mail in.
* The default is sup://sent
* A FatalSourceError is raised in the event that sent_source is
set to a source type that doesn't support the store_message() method.
* SentManager and SentLoader have been somewhat decoupled.
Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>