[EXIM] Mail filters - various things.

Top Page
Delete this message
Reply to this message
Author: Alistair Young
Date:  
To: exim-users
Subject: [EXIM] Mail filters - various things.

(Apologies if you see this twice - I have reason to suspect the first
copy never made it as far as the list...)

First, a couple of what are probably wish list items:

I've noticed what I think might be a little oddity with the definition
of 'personal' in mail filters. The condition it uses for testing for
personal mail starts:

$header_to: contains $local_part@$domain and...

The problem I had with it is that I use multiple personal mailboxes,
using local-part suffixes, and none of those are recognised as
personal by the 'personal' condition. Perhaps, for that, it might be
better to define it as

$header_to: contains $local_part_prefix$local_part$local_part_suffix

?

Secondly, I'm using the following section in my system filter file to
try to cut down on the amount of junk mail I receive:

if $header_x-uidl: is not "" then
log "message $message_id from $header_from: to $header_to: failed."
log " x-uidl header indicates probable spam."
log "--------------------------------------------------------------------"
fail
endif

This works for some of it, but a couple of messages have been getting
through which do possess the telltale X-UIDL: header, but which have
it blank. Is there any way to tell the difference between an empty
header and a nonexistent one in a filter file?

Lastly, and rather embarrassingly, there's one quirk which - despite
much reading of manuals - I'm still not sure whether it is the
intended behaviour or a bug I've accidentally intoduced into the OS/2
port.

I'm using the following .forward file to, theoretically, send a single
autoreply to anyone sending me mail who I haven't already spoken
with:

# Exim filter

# Drop out on error
if error_message then finish endif

# Ignore list and autoresponder mail
if $header_precedence: is "junk" or
$header_precedence: is "list" then finish endif

# Handle personal e-mail
if ( personal alias sloth@??? alias sloth@??? alias narg@??? ) or
   ( $header_to: contains $local_part$local_part_suffix@$domain and
     $header_from: does not contain server@ and
     $header_from: does not contain daemon@ and
     $header_from: does not contain root@ and
     $header_subject: does not contain "circular" and
     $header_precedence: does not contain "bulk" )
then
   # Send an automagic reply to all e-mails from people I haven't already dealt with
   unseen mail subject "Your message for $local_part received at $tod_bsdinbox"
       expand file "/home/avatar/.autoreply.all-new-messages"
       log "/home/avatar/.autoreply.all-new-messages.log"
       once "/home/avatar/.autoreply.all-new-messages.once"
endif


The problem, though, again comes with the local-part suffix. When
someone sends mail to my address with a bare username,
<avatar@???>, everything works as expected - an
autoreply is sent, and the mail is delivered to my mailbox.

However, when I receive mail to an address with a local-part suffix,
such as the <avatar-usenet@???> I use for posting to
Usenet, the autoreply is still sent, but the mail isn't delivered.

(Relevant Debugging output for both cases included below, if it's needed.)

Is this expected? Do I need to attach an explicit 'deliver' to the end
to make it work?

Alistair

-- 
Computational Thaumaturge  --  Sysimperator, dominus retis deusque machinarum.
e-mail: avatar-sig@???      WWW: http://www.arkane.demon.co.uk/
"For badgers, the entire universe has been neatly divided into things to
 (a) mate with, (b) eat, (c) insult, and (d) mate with."
   -- Karl-Johan Nore'n <k-j-nore@???>


For a delivery to 'avatar@???':

----------------------------------------------------------------------
1091 bytes read from /home/avatar/.forward
file is a filter file
Filter: start of processing
Filter: condition is false: error_message
Filter: condition is false: $header_precedence: is "junk" or

$header_precedence: is "list"
Filter: condition is true: ( personal alias sloth@??? alias sloth@??? alias narg@??? ) or

( $header_to: contains $local_part$local_part_suffix@$domain and

     $header_from: does not contain server@ and


     $header_from: does not contain daemon@ and


     $header_from: does not contain root@ and


     $header_subject: does not contain "circular" and


     $header_precedence: does not contain "bulk" )


Filter: mail to: sloth@???
        subject: Your message for avatar received at Tue Dec 16 19:58:35 1997
           file: /home/avatar/.autoreply.all-new-messages (expanded)
            log: /home/avatar/.autoreply.all-new-messages.log
           once: /home/avatar/.autoreply.all-new-messages.once
Filter: at end "delivered" is false
Filter: end of processing
userforward director generated >sloth@???
  pipe, file, or autoreply
userforward director generated avatar@???
userforward director succeeded for avatar
  transport: <none>
opened DB file /exim/spool/db/retry: flags=0
unique = \avatar@???
dbfn_read: key=D:avatar@???
avatar@???: queued for directing
unique = >sloth@???:avatar@???

>>>>>>>>>>>>>>>>>>>>>>>>

directing avatar@???
calling system_real_names director
system_real_names director: file = /etc/realnames search type = 48
file=/etc/realnames query=avatar
search_open found (0) /etc/realnames cached
search_find: file="/etc/realnames" type=0 key="avatar" partial=-1
internal_search_find: file="/etc/realnames" type=0 key="avatar"
file lookup required for avatar in /etc/realnames
system_real_names director failed for avatar: 
calling system_aliases director
system_aliases director: file = /etc/aliases search type = 48
file=/etc/aliases query=avatar
search_open found (0) /etc/aliases cached
search_find: file="/etc/aliases" type=0 key="avatar" partial=-1
internal_search_find: file="/etc/aliases" type=0 key="avatar"
file lookup required for avatar in /etc/aliases
system_aliases director failed for avatar: 
lists director skipped: prefix mismatch
real_localuser director skipped: prefix mismatch
pgpkey_localuser director skipped: prefix mismatch
userforward director skipped: previously directed avatar@???
calling localuser director
localuser director succeeded for avatar
  transport: local_delivery
After directing:
  Local addresses:
    avatar@???
    >sloth@???
  Remote addresses:
  Failed addresses:
  Addresses to be routed:
  Deferred addresses:
----------------------------------------------------------------------


For a delivery to 'avatar-usenet@???'

----------------------------------------------------------------------
1091 bytes read from /home/avatar/.forward
file is a filter file
Filter: start of processing
Filter: condition is false: error_message
Filter: condition is false: $header_precedence: is "junk" or

$header_precedence: is "list"
Filter: condition is true: ( personal alias sloth@??? alias sloth@??? alias narg@??? ) or

( $header_to: contains $local_part$local_part_suffix@$domain and

     $header_from: does not contain server@ and


     $header_from: does not contain daemon@ and


     $header_from: does not contain root@ and


     $header_subject: does not contain "circular" and


     $header_precedence: does not contain "bulk" )


Filter: mail to: sloth@???
        subject: Your message for avatar received at Tue Dec 16 19:59:39 1997
           file: /home/avatar/.autoreply.all-new-messages (expanded)
            log: /home/avatar/.autoreply.all-new-messages.log
           once: /home/avatar/.autoreply.all-new-messages.once
Filter: at end "delivered" is false
Filter: end of processing
userforward director generated >sloth@???
  pipe, file, or autoreply
userforward director generated avatar-usenet@???
userforward director succeeded for avatar
  transport: <none>
opened DB file /exim/spool/db/retry: flags=0
unique = avatar-usenet@???
avatar-usenet@??? is a duplicate address: discarded
unique = >sloth@???:avatar-usenet@???
After directing:
  Local addresses:
    >sloth@???
  Remote addresses:
  Failed addresses:
  Addresses to be routed:
  Deferred addresses:
----------------------------------------------------------------------


--
*** Exim information can be found at http://www.exim.org/ ***