Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
* [sup-talk] How to ignore some mails in searches?
@ 2010-01-26 17:17 Gregor Hoffleit
  2010-01-26 17:42 ` William Morgan
  0 siblings, 1 reply; 3+ messages in thread
From: Gregor Hoffleit @ 2010-01-26 17:17 UTC (permalink / raw)
  To: sup-talk

I get a ton of mails from cron jobs on various machines like logcheck,
which are archived right away (in before-add-message.rb).

Problem is that these mails still show up in search results. This is a
real problem, since e.g. almost every search for a mail address will
match to some logcheck report mail from the mail server.

Now I could just add '-label:cronjob' to any search, but that tedious.
I'd like to filter out those mails by default, but still being able to
include them in a search, if I want to.

That sounds a lot like the semantics of the 'Spam' reserved label, but
without Spam in it ;-)

I guess there is some easy solution I'm missing!?

Regards,
    Gregor Hoffleit
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [sup-talk] How to ignore some mails in searches?
  2010-01-26 17:17 [sup-talk] How to ignore some mails in searches? Gregor Hoffleit
@ 2010-01-26 17:42 ` William Morgan
  2010-01-27 11:57   ` Gregor Hoffleit
  0 siblings, 1 reply; 3+ messages in thread
From: William Morgan @ 2010-01-26 17:42 UTC (permalink / raw)
  To: sup-talk

Reformatted excerpts from Gregor Hoffleit's message of 2010-01-26:
> Now I could just add '-label:cronjob' to any search, but that tedious.
> I'd like to filter out those mails by default, but still being able to
> include them in a search, if I want to.
> 
> That sounds a lot like the semantics of the 'Spam' reserved label, but
> without Spam in it ;-)
> 
> I guess there is some easy solution I'm missing!?

You can use the custom-search hook to accomplish this. For complicated
reasons, it doesn't show up in `sup -l` right now, but here's the docs:

  Executes before a string search is applied to the index,
  returning a new search string.
  Variables:
    subs: The string being searched.

I would try something like

  subs =~ /label:cronjob/ ? subs : subs + " -label:cronjob"

Which will automatically add that search term unless the query already
contains it.
-- 
William <wmorgan-sup@masanjin.net>
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [sup-talk] How to ignore some mails in searches?
  2010-01-26 17:42 ` William Morgan
@ 2010-01-27 11:57   ` Gregor Hoffleit
  0 siblings, 0 replies; 3+ messages in thread
From: Gregor Hoffleit @ 2010-01-27 11:57 UTC (permalink / raw)
  To: sup-talk

* William Morgan <wmorgan-sup@masanjin.net> [Di Jan 26 18:42:11 +0100 2010]
> You can use the custom-search hook to accomplish this. For complicated
> reasons, it doesn't show up in `sup -l` right now, but here's the docs:
> 
>   Executes before a string search is applied to the index,
>   returning a new search string.
>   Variables:
>     subs: The string being searched.
> 
> I would try something like
> 
>   subs =~ /label:cronjob/ ? subs : subs + " -label:cronjob"
> 
> Which will automatically add that search term unless the query already
> contains it.

Ah, that's fine!

One last thing, though: Provided the setup above, how can I search
through all threads, regardless of the label cronjob?

Is there any easy way?

    - "stupid" will ignore cronjobs
    - "stupid label:cronjob" will only return cronjobs
    - "label:cronjob || -label:cronjob stupid" doesn't seem to work


Regards,
    Gregor
_______________________________________________
sup-talk mailing list
sup-talk@rubyforge.org
http://rubyforge.org/mailman/listinfo/sup-talk


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-01-27 11:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-26 17:17 [sup-talk] How to ignore some mails in searches? Gregor Hoffleit
2010-01-26 17:42 ` William Morgan
2010-01-27 11:57   ` Gregor Hoffleit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox