On Wednesday 22 October 2003 10:00, Andreas Metzler wrote:
> I actually don't see the need for forceoutside_part2 and allelse
> unless you need different routing for mail originating on your server
> and targeted to foo@??? and for mail sent to
> foo-outside@???.
Thats what I need to do - mail coming from outside, should fail for an address
for instance alan-outside@???. Whereas, if I send it from
a local machine inside my network, I am routing it, as recipient
alan@??? to my ISP as though it had come from
alan.chandler@???. The ISPs mail server will route it back in
to me as though it was an external mail for local user. I often use this to
test things I am trying out.
I have to use the redirect router of forceoutside to rewrite the addresses,
but then have to avoid the localuser router so that I don't immediately
deliver it locally.
Actually I think I have solved it - as follows
forceoutside:
driver = redirect
data = $local_part@???
local_part_suffix = -outside
local_parts = CONFDIR/local-users
verify = no
redirect_router = forceoutside_part2
retry_use_local_part
localuser:
driver = accept
local_parts = CONFDIR/local-users
retry_use_local_part
transport = local_delivery
user = ${lc:$local_part}
forceoutside_part2:
driver = accept
verify = no
transport = outside_smtp
local_parts = CONFDIR/local-users
I DO have a verify recipients so these would not verify if they happened to
use -outside, but for mail from internal hosts, the forceoutside is tried
first and if it succeeds we just to forceoutside_part2. If it doesn't then
local user only succeeds for users in CONFDIR/local-users. I did try a more
= no at the end of this but it didn't work, so now if a local user whose name
is not in CONFDIR/local-users falls through it will also no it
forceoutside_part2 because I put the same condition check on it again (this
is acceptable for redirected -outside really only should deliver if its
ultimately a valid local user).
--
Alan Chandler
alan@???