Header and other questions

2011-05-14 Thread mueen
Hi,

1. How do I see *all* the headers using the emacs interface? It shows me
only 4 headers.

2. Using the Python bindings, I want to do a query, get the messages,
and examine the headers of the messages. The problem is that if a
message is multi-part, then, I can't find any way to see the main
headers. I can only see the "headers" of each part. (I really would like
this working!)

3. Can I mark a bunch of messages for tagging in the Emacs interface? I
know I can tag all messages in a query, but sometimes I'd just like to
select a few manually and tag them (or apply some other command to
them).

Using notmuch 0.5-83-g74bc93f

Thanks.


___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Header and other questions

2011-05-14 Thread mu...@nawaz.org
Hi,

1. How do I see *all* the headers using the emacs interface? It shows me
only 4 headers.

2. Using the Python bindings, I want to do a query, get the messages,
and examine the headers of the messages. The problem is that if a
message is multi-part, then, I can't find any way to see the main
headers. I can only see the "headers" of each part. (I really would like
this working!)

3. Can I mark a bunch of messages for tagging in the Emacs interface? I
know I can tag all messages in a query, but sometimes I'd just like to
select a few manually and tag them (or apply some other command to
them).

Using notmuch 0.5-83-g74bc93f

Thanks.




Re: storing From and Subject in xapian

2011-05-14 Thread servilio
On 12 May 2011 04:39, Istvan Marko  wrote:
> Stewart Smith  writes:
>
>> Would it be possible to progressively fill the DB with the new data?
>>
>> i.e.
>>
>> if Subject/From not in db for message
>>    add Subject/From for this message to DB.
>
> I started looking into this but then realized that notmuch search opens
> the database in read-only mode so it cannot make updates. It might be
> desirable to keep it that way for safety and locking reasons.

What about the following:

- increase NOTMUCH_DATABASE_VERSION[1]
- update notmuch_database_upgrade[2] to fill in the new data for the
documents missing it
- include an upgradedb command that wraps notmuch_database_upgrade[2]
- have notmuch search prints a warning about running a DB version less
than the runtime and suggests running upgradedb

Regards,

Servilio

[1] http://git.notmuchmail.org/git/notmuch/blob/HEAD:/lib/database.cc#l39
[2] http://git.notmuchmail.org/git/notmuch/blob/HEAD:/lib/database.cc#l765
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


storing From and Subject in xapian

2011-05-14 Thread Austin Clements
I wonder if a better approach would be to use
notmuch_message_get_header everywhere, rather than introducing
_notmuch_message_get_header_value, and have it simply recognize
headers that can be retrieved directly from the database.  Then
library callers could take advantage of this optimization and it could
be trivially extended to other headers in the future.

On Tue, May 3, 2011 at 11:40 PM, Istvan Marko  wrote:
> I have been looking at the I/O patterns of "notmuch search" with the
> default output format and noticed that it has to parse the maildir file
> of every matched message to get the From and Subject headers. I figured
> that this must be slowing things down, especially when the files are not
> in the filesystem cache.
>
> So I wanted to see how much difference would it make to have the From
> and Subject stored in xapian to avoid this parsing.
>
> With the attached patch I get a speedup of 2x with cached and almost 10x
> with uncached files for searches with many matches.
>
> The attached patch is only intended as proof of concept. I am not
> familiar with xapian so I wasn't sure if this kind of data should be
> stored as terms, values or data. I went with values simply because I saw
> that message-id and timestamp were already stored that way. Perhaps the
> data type would be more appropriate since the fields are not used for
> searching or sorting. Oh and for some reason I get blank Subject for
> about 1% of the matches.
>
>
> Is there a downside to this approach? The only one I see is that the
> xapian db size increases by about 1% but to me the speed increase would
> be well worth it.


Re: storing From and Subject in xapian

2011-05-14 Thread Austin Clements
I wonder if a better approach would be to use
notmuch_message_get_header everywhere, rather than introducing
_notmuch_message_get_header_value, and have it simply recognize
headers that can be retrieved directly from the database.  Then
library callers could take advantage of this optimization and it could
be trivially extended to other headers in the future.

On Tue, May 3, 2011 at 11:40 PM, Istvan Marko  wrote:
> I have been looking at the I/O patterns of "notmuch search" with the
> default output format and noticed that it has to parse the maildir file
> of every matched message to get the From and Subject headers. I figured
> that this must be slowing things down, especially when the files are not
> in the filesystem cache.
>
> So I wanted to see how much difference would it make to have the From
> and Subject stored in xapian to avoid this parsing.
>
> With the attached patch I get a speedup of 2x with cached and almost 10x
> with uncached files for searches with many matches.
>
> The attached patch is only intended as proof of concept. I am not
> familiar with xapian so I wasn't sure if this kind of data should be
> stored as terms, values or data. I went with values simply because I saw
> that message-id and timestamp were already stored that way. Perhaps the
> data type would be more appropriate since the fields are not used for
> searching or sorting. Oh and for some reason I get blank Subject for
> about 1% of the matches.
>
>
> Is there a downside to this approach? The only one I see is that the
> xapian db size increases by about 1% but to me the speed increase would
> be well worth it.
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


Warning when GMime is parsing broken email addresses

2011-05-14 Thread Matthieu Lemerre
On Wed, 27 Apr 2011 21:59:09 +0200, Pieter Praet  wrote:
> On Wed, 27 Apr 2011 18:30:09 +0200, Xavier Maillard  
> wrote:
> > On Mon, 25 Apr 2011 15:23:41 -0700, Carl Worth  wrote:
> > > On Wed, 17 Nov 2010 23:20:26 +0100, Matthieu Lemerre  
> > > wrote:
> > > > Maybe it would also be interesting to add a warning/assertion to check
> > > > that all email adresses added to the database are correct email
> > > > addresses? I.e. check that the `addr' variable in _index_address_mailbox
> > > > always has a @. This check is in fact already done using the function
> > > > strchr, but a bad value is explicitly ignored...
> > > 
> > > Since GMime is fixed upstream (as of version 2.4.18) another option
> > > would be to simply make the notmuch build system require a sufficiently
> > > new version of GMime in order to build.
> > > 
> > > What do you think?
> 
> I'd say both.
> 
> Unfortunately, regressions are not uncommon, and regardless, it'd be
> nice to be notified when what we stuff in the db is not sane.
> 
> It would however be a good idea IMHO to check email address more
> thorougly [1] than simply verifying whether an "@" is present.

I agree with that, unless it is undesirable to add a dependency to a
regex library to notmuch? If so, the @ check could still be done (and is
_already_ present).

I don't see the warnings either, but maybe with proper differentiation
between stdout and stderr, I could arrange to print stderr and see the
warning messages in emacs when I explicitely launch my mail
synchronization script.

Matthieu