Re: [Evolution] new feature request -- customise action of 'junk' button

On Sat, 2005-01-15 at 12:41 +1300, Russell Fulton wrote:
On Fri, 2005-01-14 at 09:11 -0500, JP Rosevear wrote:
On Fri, 2005-01-14 at 22:11 +0000, Jon Biddell wrote:
So I would like a configuration option that allowed one to automatically
forward any message marked as 'junk' to a specific mailbox or an

I second that - being able to attach a customisable script to both
buttons would be a nice feature.

FWIW, you should be able to create your own sa-learn script in your path
that does whatever you want.

OK, I'm happy with that, except that I can't figure out how the mail is
passed to sa-learn.  So far as I can tell evo invokes sa-learn with the
parameters "--rebuild --local" and does not read anything from stdin.

I've found a copy of the sa-learn man page and I can't find any
reference to --rebuild.  sa-learn seems to expect to be pointed at a

Any hints on how to get the script to read the offending email?

To find out, I did the following (old Unix trick):

Temporarily replace /usr/bin/sa-learn with the following Shell script:


date >> /tmp/sa-learn-args # Just to separate runs
echo $@ >> /tmp/sa-learn-args # Get the args
while read -t 1 l # Copy stdin
echo $l >> /tmp/sa-learn-args

Mark a few messages as junk and look at /tmp/sa-learn-args. Turns out
that Evo calls sa-learn once per message with the options "--no-rebuild
--spam --single" and then once at the end of a batch with "--rebuild" (a
batch being a set of messages selected and marked simultaneously).

sa-learn gets the message itself on standard input (sorry for the kludgy
loop copying stdin; I tried just doing a "cat >> file" but it hung, so I
had to use the "-t" option on "read").

Don't forget to restore the original sa-learn when you're done :-)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]