Hi,

Thanks for the quick reply; sorry for my slow one.

Excerpts from William Morgan's message of Wed Dec 17 23:46:15 +0100 2008:
> Reformatted excerpts from marianne.promberger+sup-talk's message of 
> 2008-12-17:

> > (1) Automatically apply labels to incoming mail defined on search
> > patterns?
> 
> Stuff like that is handled by Sup's hook system. 

Thanks! I found more examples on the wiki. Is there any more
documentation on the hook system? I've found
/var/lib/gems/1.8/doc/sup-0.6/rdoc/index.html 
but I have trouble getting anything out of it. Sorry if this is
obvious to others, but I am not a programmer and haven't used Ruby
before.

I cobbled two together, but I'm less than sure that they're correct;
they seem to work for me. If someone could give me the go-ahead, I'd
post them to the wiki, since I think it would be nice to have some
more recipes for others to copy.

This one assigns labels according to X-Label header. I'd like to do
this since I already add some labels with procmail before mail goes to
the maildir that is a source for sup. (Not sure the regex matching the
label is exhaustive enough for everyone; it is for me).

if message.raw_header =~ /X-Label: /
  xlabelheader = message.raw_header[/X-Label:.*/]
  xlabelheader.scan(/ [a-z0-9\-_+]+/) { |x| message.add_label x.lstrip }
end

The second one assigns labels based on an external file containing a
list of e-mail addresses. The external file is one I maintain from
mutt; I have a macro set up to quickly add the sender of a message to
my "private" group.

privatfile = File.open("/home/mpromber/.mutt/privataddr","r")
if ! privatfile.grep(/#{message.from.email}/).empty?
message.add_label :privat
end

Another question: If I add a new rule like this to the
before-add-message hook, what is the recommended way to get sup to
rescan messages to apply this rule to all existing mail? 

I am currently using "sup-sync -a --discard -e -x -v", but this takes
forever (and I can't use regular "sup" in the meantime). (I'm using the
-e because "sup-sync" on its own marks all mail as unread, even just
running "sup-sync -c".) Is it correct that there is no faster way?

> > (2) Save search history across sup sessions, so that I can use
> > up-arrow to access terms I searched for last time I read mail in sup?
> 
> Not implemented, but a good idea, and probably pretty easy!

I've been thinking about this some more, and maybe even better would
be not to save all searches, but to have the possibility to explicitly
save some searches. This would turn the saved searches into a list of
quickly accessible virtual mail folders. Maybe a shortcut to do this
could be added to the buffer-list-mode? To start, it could even just
be an external text file that has to be edited manually. Sorry I can't
write patches in ruby :) 

> You can search for things like "from:me" or "to:me". That should work
> with :alternates, but unfortunately doesn't work if you use :regexen.

Thanks. Another question: Is there a search term like "from:" and
"to:" but that stands for "anywhere in "from" or "to" or "cc" (like
"a:" in mairix)?

In general, is there more documentation about the search capacities,
especially on building search terms, and where could I find it?

One more question: Is there some way to have more fine-grained control
over what the "From" e-mail address is when replying? As far as I
understand it, I can have ":accounts:" sections in config.yaml, with
different "alternates". Sup will reply from the e-mail address that
someone uses as "to:" when e-mailing me. But for example, I'd like to
use my "[email protected]" address when replying to this list,
but obviously, mail to this list has "sup-talk..." as the "to:"
address. And the point of the "accounts" in config.yaml is just
picking the right signature, right? I haven't discovered any other
effect so far.

Thanks,

Marianne
_______________________________________________
sup-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/sup-talk

Reply via email to