Forwarding question (was: [Exim] Unable to send mail)

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Bo Mellberg
Dátum:  
Címzett: exim users
Tárgy: Forwarding question (was: [Exim] Unable to send mail)
Hi all and thanks for your help with my last question.
I dunno why I couldnt think of the answer myself, I
setup the Exim user with as few priviliges as possible
and didnt think of the directory access...

Anyway, now that I got exim working I would like to do
the following:

1. Match any incoming mail against a mysql database, if
a match is found send it to the appropriate address(es).

2. If no match is found try delivering the mail to a local
mailbox (root, etc)

3. If no local user matches, then reply to sender with a
"no such user at yyy@???".

The first two I thought was going to solve themselves but
no mail gets to #2 above. What am I doing wrong and how
should I implement #3?. I use the mysql lookup in this way:

######################################################################
#                    MAIN CONFIGURATION SETTINGS                     #
######################################################################


# mySql connection
mysql_servers = localhost/lve/lve/*password*
...

######################################################################
#                      ROUTERS CONFIGURATION                         #
#               Specifies how addresses are handled                  #
######################################################################
#     THE ORDER IN WHICH THE ROUTERS ARE DEFINED IS IMPORTANT!       #
# An address is passed to each router in turn until it is accepted.  #
######################################################################


begin routers
...
system_aliases:
driver = redirect
allow_fail
allow_defer
data = ${lookup{$local_part}lsearch{/etc/aliases}}
# user = exim
file_transport = address_file
pipe_transport = address_pipe

mysql_system_aliases:
driver = redirect
allow_fail
file_transport = address_file
pipe_transport = address_pipe
data = ${lookup mysql{select members.emailaddress from members,
$local_part where members.sheetnumber = $local_part.sheetnumber}{$value}fail
}

userforward:
driver = redirect
check_local_user
file = $home/.forward
no_verify
no_expn
check_ancestor
# allow_filter
file_transport = address_file
pipe_transport = address_pipe
reply_transport = address_reply

# This router matches local user mailboxes.

localuser:
driver = accept
check_local_user
transport = local_delivery

-----------------------------------------------