[Exim] Trouble using SpamAssassin on an intermediate Exim MT…

Página Principal
Apagar esta mensagem
Responder a esta mensagem
Autor: David Gardner
Data:  
Para: exim-users
Assunto: [Exim] Trouble using SpamAssassin on an intermediate Exim MTA...
Greetings all,

I've been trying to get SpamAssassin to work on my Exim 3.22 box that
is an intermediate MTA. I've been working with the documentation
provided by D-Man on the web page
http://dman.ddts.net/~dman/config_docs/exim3_spamassassin.html.
After reading the appropriate chapters of the Exim book by Philip Hazel,
I realized that D-Man's configuration is for a terminal MTA (he, like
others on the web, is using a Director) while I need to pass/no pass a
message on to the terminal MTA (use a Router.) I merged the book's
discussion about configuring a virus scanner and D-Man's Director block
as my model for the SpamAssassin router (shown at the bottom of this
message.)

The trouble I'm having is that although the SpamAssassin router comes
before the "forwarding" in the configuration, it looks like the message
is "forwarded" and is filtered by the SA router in parallel. For
example, when I send an email from an external account to my office
account, the exim_mainlog shows the following for that message:

"...snip..."
2002-05-06 14:15:05 174pp3-0005Ml-00 <= dgardner@???
H=easystreet.com
(smtp.easystreet.com) [206.26.36.40] P=esmtp S=999
id=3CD6F257.7B61C8BD@easystr
eet.com
2002-05-06 14:15:05 174pp3-0005Mo-00 <= dgardner@??? U=mail
P=spam-sc
anned S=1154 id=3CD6F257.7B61C8BD@???
2002-05-06 14:15:05 174pp3-0005Mo-00 => dgardner@???
R=hubbed_hosts T=re
mote_smtp H=ares [192.168.254.11]
2002-05-06 14:15:05 174pp3-0005Mo-00 Completed
2002-05-06 14:15:05 174pp3-0005Ml-00 => dgardner@???
R=spamcheck_router
T=spamcheck
2002-05-06 14:15:05 174pp3-0005Ml-00 Completed
"...snip..."

Messages still go through the system but I would have expected (all
with the same message ID):
the message to be delivered to Exim, (line 1 above)
the message to be delivered to the SA router, (line 2 above)
the SA router delivers the message back to Exim with a modified
header, (line 5 above)
the message is then forwarded (or not) to the terminal MTA (line 4
above.)

My exim.filter file looks for $h_X-Spam-Flag to contain "yes" for
logging and saving the file. It seems clear to me that I am missing some
little detail. Can someone help me out here?



<><><><><><><><><><><><>

The following is an excerpt from my exim.conf file:
"...snip..."
######################################################################
#                      TRANSPORTS CONFIGURATION                      #
######################################################################
#                       ORDER DOES NOT MATTER                        #
#     Only one appropriate transport is called for each delivery.    #
######################################################################


# A transport is used only when referenced from a director or a router
that
# successfully handles an address.


# This transport is used for delivering messages over SMTP
connections.

remote_smtp:
driver = smtp

# This transport is used for local delivery to user mailboxes in
traditional
# BSD mailbox format. By default it will be run under the uid and gid
of the
# local user, and requires the sticky bit to be set on the /var/mail
directory.
# Some systems use the alternative approach of running mail deliveries
under a
# particular group instead of using the sticky bit. The commented
options below
# show how this can be done.

local_delivery:
driver = appendfile
file = /var/mail/$local_part
delivery_date_add
envelope_to_add
return_path_add
group = mail
mode = 0660


# This transport is used for handling pipe deliveries generated by
alias
# or .forward files. If the pipe generates any standard output, it is
returned
# to the sender of the message as a delivery error. Set
return_fail_output
# instead of return_output if you want this to happen only when the
pipe fails
# to complete normally. You can set different transports for aliases
and
# forwards if you want to - see the references to address_pipe in the
directors
# section below.

address_pipe:
driver = pipe
return_output


# This transport is used for handling deliveries directly to files that
are
# generated by aliasing or forwarding.

address_file:
driver = appendfile
delivery_date_add
envelope_to_add
return_path_add


# This transport is used for handling autoreplies generated by the
filtering
# option of the forwardfile director.

address_reply:
driver = autoreply


#
# Spam Assassin
#
# 02may2002, djg
#
spamcheck:

# from http://dman.ddts.net/~dman/config_docs/exim3_spamassassin.html

driver = pipe

command = /usr/sbin/exim -oMr spam-scanned -bS
transport_filter = /usr/local/bin/spamc

bsmtp = all

# the user and group mail have read/write access to this folder
home_directory = "/tmp/spamcheck"
current_directory = "/tmp/spamcheck"

# must use a privileged user to set $received_protocol on the way back
in!
user = mail
group = mail

return_path_add = false

log_output = true
return_fail_output = true

prefix =
suffix =





######################################################################
#                      DIRECTORS CONFIGURATION                       #
#             Specifies how local addresses are handled              #
######################################################################
#                          ORDER DOES MATTER                         #
#   A local address is passed to each in turn until it is accepted.  #
######################################################################


"...snip..."


######################################################################
#                      ROUTERS CONFIGURATION                         #
#            Specifies how remote addresses are handled              #
######################################################################
#                          ORDER DOES MATTER                         #
#  A remote address is passed to each in turn until it is accepted.  #
######################################################################


# Remote addresses are those with a domain that does not match any
item
# in the "local_domains" setting above.

spamcheck_router:
# from http://dman.ddts.net/~dman/config_docs/exim3_spamassassin.html
#
# When to scan a message :
#   -   it isn't already flagged as spam
#   -   it isn't already scanned
#   -   it didn't originate locally (as long as I don't harbor
spammers)
   condition = "${if and { {!def:h_X-Spam-Flag:} \
                           {!eq {$received_protocol}{spam-scanned}} \
                           {!eq {$received_protocol}{local}} } \
                           {1}{0} }"
   driver = domainlist
   transport = spamcheck
   route_list = *



#This router routes to the internal Novell server for vernier.com

hubbed_hosts:
driver = domainlist
transport = remote_smtp
route_list = vernier.com ares.vernier.com byname

# This router routes to remote hosts over SMTP using a DNS lookup with
# default options.

lookuphost:
driver = lookuphost
transport = remote_smtp



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
David Gardner
Vernier Software & Technology
13979 SW Millikan Way
Beaverton, OR 97005-2886

phone: (503) 277-2299
fax: (503) 277-2440
email: dgardner@???
WWW: http://www.vernier.com/