Re: [exim] rejecting messages for unknown virtual users

Top Page
Delete this message
Reply to this message
Author: oliverj
Date:  
To: Tony Finch
CC: exim-users
Subject: Re: [exim] rejecting messages for unknown virtual users


sorry if i didnt explain things properly. when you say :-

"If you just return the string then Exim will do the existence
check, and if it fails the router will not accept the address and
address verification will fail"

- that is what the perl subroutine does. it returns the string if the mail directory
exists (ie it will return "/disk_01/data/mail/mydomain.net/fred"), and undef if it doesnt.
i have to use this, otherwise exim has no way of knowing where the mail directory is for
these virtual users. the problem i'm having is if that if the mail directory doesnt exist,
then the message is still handled by the localuser router and remains on the mail queue,
when what i really want it to do is be rejected by the localuser router and then get handled by the
following unknown_user router which silently discards the message :-


localuser:
driver = accept
domains = +local_domains
transport = local_delivery

unknown_user:
driver = redirect
domains = +local_domains
data = :blackhole:





so did you mean that i should have changed something in the local_delivery transport instead?


local_delivery:
driver = appendfile
directory = ${perl {get_user_dir}{$local_part}{$domain}}
user = exim
file_must_exist
no_check_owner
maildir_format
mode = 0660
delivery_date_add
envelope_to_add
return_path_add
quota = ${lookup{$local_part@$domain}dbm{/etc/mail/quota.db}}






"
You should change your perl routine so that it does not do the existence
check. When the perl routine returns undef the require_files precondition
does nothing so the router accepts the address despite the file not
existing. When the perl routine returns a path the require_files
precondition is redundant because you've already checked that the file
exists. If you just return the string then Exim will do the existence
check, and if it fails the router will not accept the address and
address verification will fail, which is what you want.
"



thanks for helping



on 20.01.05, Tony Finch wrote:
> On Thu, 20 Jan 2005, oliverj wrote:
> >
> > I took the existence check out of the router, so now it is :-
>
> That isn't what I told you to do. The answer to your problem is in my
> previous message.
>
> > so is there something i can change in my local_delivery router so that
> > it will fail immediately if there is no directory?
>
> Leave the require_files condititon on the router, and change the Perl
> routine so that it doesn't lie to Exim.
>
> Tony.
> --
> <fanf@???> <dot@???> http://dotat.at/ ${sg{\N${sg{\
> N\}{([^N]*)(.)(.)(.*)}{\$1\$3\$2\$1\$3\n\$2\$3\$4\$3\n\$3\$2\$4}}\
> \N}{([^N]*)(.)(.)(.*)}{\$1\$3\$2\$1\$3\n\$2\$3\$4\$3\n\$3\$2\$4}}
>
> --
> ## List details at http://www.exim.org/mailman/listinfo/exim-users Exim details at http://www.exim.org/ ##
>

</>

--


Oliver Howe
Technical Developer

BiblioTech
Unit 3, 50 Carnwarth Road
London SW6 3EG

DDI: +44 (0) 20 7384 6929
Tel: +44 (0) 20 7384 6900
Fax: +44 (0) 20 7384 6901

oliverj@???

www.bibliotech.net
www.homemaster.net
www.officemaster.net
www.postmaster.co.uk
www.schoolmaster.net

IMPORTANT: The contents of this email, and any attachments, are CONFIDENTIAL
and intended only for the person(s) to whom they are addressed. If you have
received the email in error please notify the sender immediately and delete
it from your computer system. Do not copy or distribute it or disclose its
contents to any person. Unless otherwise stated, the views and opinions
expressed in this email are personal to the sender and do not represent the
official view of the company.