From: Mathias Wrede [mailto:[EMAIL PROTECTED]
> 
> Hi list,
> 
> in wich way could I make the following line compatible to sa-learn?
> # sa-learn --ham  `find /var/spool/imap/user \( -name '*.' -o -name Spam
> -prune -o -name System -prune -o -name Trash -prune -o -name Virus -prune
\)
> -type f`
> 
> My problem: There could be blanks in the pathnames.

Hmmmm...maybe something like this:

# find /var/spool/imap/user \( -name '*.' -o 
-name Spam -prune -o -name System -prune -o -name Trash -prune -o -name
Virus
-prune \) -type f -print0 | xargs -i --null sa-learn --nosync --ham '{}'

(That should all be one line)

Followed by:
# sa-learn --sync


The -print0 creates a null-separated list of filenames.  The call to xargs
breaks them apart and feeds them to sa-learn one at a time.  For a bit of
extra speed, the --nosync option is used for learning each email, and then
an
explicit --sync is run afterwards.

It is also possible that I'm making this way too complicated, but I don't
know
of any easier way offhand.

Bowie

Reply via email to