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

Re: Killfiling people with procmail or exim (Was: Re: Gnome problems in unstable)



* Wayne Topa (brittman@capital.net) [030421 13:30]:
> ScruLoose(scruloose+debuser@eastlink.ca) is reported to have said:
> > I think I'm a little confused about the logic of the exim filter
> > process, though...
> > What I've been using to sort my mail (list-specific inboxes, etc) runs
> > something like this:
> > 
> > if (condition)
> > then (seen save some-place)
> > endif
> > 
> > if not delivered
> > then
> >    if (other-condition)
> >    then (seen save some-other-place)
> >    endif
> > endif
> 
> I 'only' use seen in rules that discard mail.  Normal rules never use
> seen here.

Reading from the filter spec:

  The delivery commands "deliver", "save", and "pipe" are by default
  significant.  However, if such a command is preceded by the word
  "unseen", then its delivery is not considered to be significant. In
  contrast, other commands such as "mail" and "vacation" do not count as
  significant deliveries unless preceded by the word "seen".

That should clarify any questions about whether or not you should be
using "seen" in with any particular commands.  As to what a significant
delivery acually means, and whether or not you need to be wrapping each
of your tests in "if not delivered then ... endif", I'd suggest reading
the filter spec.  Personally, I'd say something like this might be
cleaner:


if (condition)
then
  (save some-place)
elif (other-condition)
then
  (save some-other-place)
elif ...
then
  ...
endif



> #Debian Mailing Lists
> if $h_X-Mailing-List: contains "debian-user"
>     then
>         save $home/mail/Lists/debian-user
>         finish
> endif
> 
> I have this as the last rule in the .forward file
> if
>    not delivered
> then
>    save $home/mail/admin
> endif
> 
> > 
> > etc.
> > 
> > Now, your usage of "seen finish" inside an if-then statement seems to
> > imply that if I slap "finish" (or "seen finish") on the end of each
> > delivery action, I won't need to do the "if not delivered" test at the
> > beginning of each condition...

It should work.  I'd be careful where you throw your "seen finish"es,
though, or you may end up losing mail.  Safer would be to use:

if (condition)
then
  save somewhere
  finish
endif

The "save" is a significant delivery, so you don't need to make the
"finish" significant by adding a "seen".  I don't know that it makes a
difference, but it sure feels safer =)  I wonder if it would make a
difference if the save fails for some reason (disk full, directory
doesn't exist, etc.)?  It might, but I don't want to claim that my
suggestion actually gives any added safety before testing it, which I
haven't.

good times,
Vineet
-- 
http://www.doorstop.net/
-- 
"If we do not believe in freedom of speech for those we despise we do not
believe in it at all."  --Noam Chomsky

Attachment: pgpZOxbaoaDGU.pgp
Description: PGP signature


Reply to: