Re: Two beginner problems - formail and bogofilter
On 11/2/05, Kyle Wheeler <kyle-mutt@xxxxxxxxxxxxxx> wrote:
> On Wednesday, November 2 at 10:49 AM, quoth Carthik Sharma:
> >$ formail -s procmail < Inbox
> >
> >I let it run overnight, and then in the morning, I found that only a
> >few messages had been processed. Significantly, some messages were not
> >re-delivered correctly. Does this always take a long, long time, or is
> >there a problem with how I am doing it?
>
> No idea - I don't use formail much (I don't trust it -- it ends up
> mangling messages more than I think it should).
>
> But, it may be faster to first convert your Inbox to a Maildir, and then
> send them through procmail, like so (uses this perl script:
> http://www.qmail.org/mbox2maildir -- remember to make a copy of your
> inbox first, as the script is destructive):
>
> env MAIL=Inbox MAILDIR=Inbox.tmp/ mbox2maildir
> for msg in Inbox.tmp/new/* ; do
> procmail < $msg &
> done
>
Nice, I will try this soon.
> >Problem 2:
> >I have the following macro for unmarking a message as spam, marking it
> >as normal mail and re-filtering it:
> >macro index H "<enter-command>unset
> >wait_key\n<pipe-entry>bogofilter -Sn -l\n<pipe-entry>formail -I
> >X-Bogosity|procmail\n<enter-command>set wait_key\n<delete-message>"
> >"Unmark as spam, mark as non-spam and refilter to correct mailbox"
> >
> >The problem is that whenever I press H from some folder, it take about
> >1-2 minutes before I can use mutt again, since I have to wait for the
> >processing to complete before I can resume using Mutt. With about 100
> >message in my "unsure-bogofilter" folder that need to be marked as
> >"not-spam" this wait is unacceptable.
> >Is there something I can do to ensure that the re-processing occurs in
> >the background, so I can continue to use Mutt after using the "H"
> >macro?
>
> Have you tried putting an ampersand in the command? Like so:
>
> macro index H "<enter-command>unset
> wait_key<enter><pipe-entry>bogofilter -Sn -l &<enter><pipe-entry>formail
> -I X-Bogosity|procmail &<enter><enter-command>set
> wait_key<enter><delete-message>" "Unmark as spam, mark as non-spam and
> refilter to correct mailbox"
>
> >I tried unsuccessfully to tag all the messages and try to do an "H" on
> >tagged messages - what is the right way of invoking a macro on all
> >tagged messages?
>
> By default? It's the ; key. You may also be interested in the auto_tag
> preference (set auto_tag).
>
If I tag 5 messages and then do a ";" and then do a "H" , it only
re-processes (Applies the macro) on the last message (currently
highlighted message). So it appears that macros are only working for
one message at a time, not a group of tagged messages, which is my
problem.
> >Also, after 3 weeks, bogofilter still incorrectly marks spam as ham
> >and ham as "unsure". Is this normal?
>
> No idea - I've never used bogofilter (I'm a spamassassin devotee). Just
> fyi, all bayesian databases rely more on the volume than the time. So
> if, in the course of 3 weeks, you've only gotten 4 spam messages (for
> example), it's probably not going to be very accurate.
>
> This is one of the main problems with filters that are exclusively
> bayesian.
>
I have received 438 spam emails and around 200 regular non-spam emails
by now, and yet bogofilter is "unsure" about (mostly) non-spam emails,
and sure that some spam emails are not spam! Is this normal?
Thanks a lot, Kyle, for your tip - I will try the maildir trick tonight.
Carthik.