Filter File Bug?

Top Page
Delete this message
Reply to this message
Author: Chris Harris
Date:  
To: exim-users
Subject: Filter File Bug?
I've setup a personal filter file here, with v1.62, in attempt to stop
spam by filtering all messages where none of my email addresses are in the
header into a junk folder, which I can look for only when I'm very bored.
I've attatched the filter file, but the basics of it go like this:

if not personal then
deliver chrish-junk@???
else
# log something
endif

The way our mail system is setup, all mail to
chrish-junk@??? will automatically be delivered to
chrish's "junk" folder, if chrish has a "junk" folder, and to his inbox
otherwise. (This is implimented as an exim transport that calls' the
UW's tmail delivery agent.) At least this is what happens when I send a
message directly (ie not inside my filter file) to
chrish-junk@???.

However, when a piece of spam that should get thrown into the junk folder
by my "trap" arrives, it arrives in my inbox. I do get an entry in my
filter log -- two in fact -- that go something like this:
junking: (sub: ''; from: 'bones@???')
ok suffix: '-junk' (sub: ''; from: 'bones@???')
But even though the mail is apparently being redirected to my chrish-junk
address, it still arrives in my inbox, which seems wrong.

One hint I have is about transports; we have two different mail delivery
address, one used for "plain" addresses, like chrish@justin, and one used
for "dashed" addresses, like chrish-junk@justin. When my pieces of spam
get through, I notice that the "plain" transport is being called, even
though the rewritten address, chrish-junk, is definitely a "dashed"
address. So it seems that exim is "forgetting" about the suffix part of
the address, and remembering only the local_part -- anoying and seemingly
buggy behavior.

I guess the paragraph in the filter docs that begins
However, if you have a mail
alias, you should not refer to it here. For example, if
the mail address "L.Gulliver" is aliased to "lg103" then all references
in Gulliver's `.forward' file should be to "lg103". A reference to the
alias will not...
might be taken as an explanation for this behavior, though I can't decide
for myself one way or another on this issue.

Could someone please tell me if I am doing something wrong, or exim has a
bug, or if this is just part of exim's non-buggy behavior that I'll have
to live with. Real people would use something like "save mail/junk" where
I have used "deliver chrish-junk@justin" in my filter file, but this is
not an option here, because we are using the mbx format for mailboxes,
which exim cannot deliver to with save. (mbx is a format developed by the
UW to be reasonably fast and multi-user when used on their IMAP servers;
I've found the normal berkeley format particularly terribly for IMAP
servers.) Any hints, if no complete answers?

Thanks.

-Chris
# Exim Filter

logfile $home/filter.log 0644

if $local_part_suffix is "" then
  if $header_to: does not contain "chrish@???" and
  $header_to: does not contain "chris_harris@???" and
  $header_to: does not contain "chrish@???" and
  $header_to: does not contain "chrish@???" and
  $header_to: does not contain "chrish@???" and
  $header_cc: does not contain "chrish@???" and
  $header_cc: does not contain "chris_harris@???" and
  $header_cc: does not contain "chrish@???" and
  $header_cc: does not contain "chrish@???" then
    log "junking: (sub: '$header_subject:'; from: '$header_from:')"
    seen deliver chrish-junk@???
  endif
else
  log "ok suffix: '$local_part_suffix' (sub: '$header_subject:'; from: '$header_from:')"
endif