<div class="gmail_quote">I sent this at first as a reply-only-to-sender. Oops! Sorry Mark for the double send.<br><br>On Wed, Jun 27, 2012 at 5:17 AM, Mark Walters <span dir="ltr"><<a href="mailto:markwalters1009@gmail.com" target="_blank">markwalters1009@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">> Personally, this isn't my favorite approach, for the following reasons:<br><div>
><br>
> 1. Notmuch, at some point in its history, chose to store file paths<br>
> relative to a "mail database", with the intent that if this mail<br>
> database was moved, filenames would not change and everything would<br>
> Just Work (tm). The above scheme completely reverses this design<br>
> decision, and in general completely breaks this relocatability. I<br>
> don't see any easy way to handle this problem. This isn't just a<br>
> wishlist feature; at least two things in the test suite (caching of<br>
> corpus.mail, and the atomicity tests) rely on this behavior.<br>
<br>
</div>Why can't the URI just store a relative path, at least for maildir://<br>
and mbox:// ? It is purely internal to notmuch so it doesn't need to be<br>
very standard.<br></blockquote><div> <br>Well, relative to where? This is especially relevant now that we can
have multiple mail stores. It sounds like you are suggesting that all
mbox:// URIs are relative to an "mbox root", but the fundamental
question is how to pass that information from the configuration into the
library.<br>
<br>Even using configuration itself may be problematic, because only the
CLI uses the configuration, and language bindings like Python and Ruby
might get out of sync! (But note also that the Python bindings currently
use .notmuch-config to find the database path, so maybe it's not a big
deal.)<br>
<br>If I could do whatever I wanted, every mailstore would get
registered somehow and the URIs could use those registered names to
specify what they're relative to: maybe using hostname, such as
maildir://university-mail/some-mail-file, mbox://old-unix-system/some.mbox.
Then changing these names in .notmuch-config would be fine. I just
don't know how to pass that configuration information without an
approach like in the past patch series.<br><div><br></div></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
> 2. Mail access information, i.e. open connections, etc. can only be<br>
> stored in variables global to the mailstore code, and cannot be stored<br>
> as private members of a mailstore object. This is more an aesthetic<br>
> concern than a functional one.<br>
><br>
> Anyhow, the following (enormous) patch series implement this design. I<br>
> used uriparser as an external library to parse URIs. The API for this<br>
> library is a little idiosyncratic. uriparser supports parsing Unicode<br>
> URIs (strings of wchar_t), but I just used ASCII filenames because I<br>
> think that's what comes out of Xapian.<br>
<br>
</div>Why use a library? Isn't it just a question of does the string contain<br>
// and, if so, splitting it? I guess that // is a nice separator as I<br>
think we can assume that a true path does not contain it (since a<br>
filename cannot contain /).<br></blockquote><div><br>The URIs are true URIs. Filenames are provided by the "path" segment of
the uri -- everything from the first slash after the hostname up to a ?
for query arguments. My concern was that filenames could (in theory)
contain # or ?, and in practice they contain : (maildir flags). I
figured it was better to do it right.<br><br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
> Patch 11 is borrowed directly from the last patch series.<br>
><br>
> The last four or five patches add mbox support, including a few<br>
> tests. That part of the series is still very first-draft: I added a<br>
> new config option to specify URIs to scan, and ">From " lines still<br>
> need to be unescaped. However, we support scanning mbox files whether<br>
> messages have content-length or not.<br>
<br>
</div>I have an idea that mbox byte-locations change when messages are marked<br>
as read (amongst other things). It might be worth saying that this<br>
initial implementation only works for unchanging mboxs (rather than the<br>
append only condition that you currently say). But I have not got as far<br>
as applying/testing the series yet.<br></blockquote><div><br>Yeah, I don't even know how an mbox message gets flagged read and I don't know how I would support it.<br><br>Ethan<br><span><font color="#888888">
</font></span></div></div><br>