[exim] rejecting messages for unknown virtual users

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: oliverj
Dátum:  
Címzett: exim-users
Tárgy: [exim] rejecting messages for unknown virtual users



i have some virtual users who i accept mail for.
each user has his own mail directory.
and i use a perl subroutine in a script to return the directory name.

so if the mail is for fred@??? and there is a mail directory on the server
for this user then the perl subroutine will return

"/data/mail/mydomain/fred"

and then exim can deliver the message into this directory.
and if the users mail directory does not exist then the perl subroutine returns undef.

but if the users mail directory does not exist, i would like to reject the message.

however, at the moment the message stays on the mail queue, with the following error :-


2005-01-19 17:46:59 1Cmwv7-0005MV-T3 == fred@??? R=localuser T=local_delivery defer (-1): Expansion of "${perl {get_user_dir}{$local_part}{$domain}}" (file or directory name for local_delivery transport) failed: Perl subroutine "get_user_dir" returned undef to force failure


this is my localuser router :-

localuser:
driver = accept
domains = +local_domains
require_files = ${perl {get_user_dir}{$local_part}{$domain}}
transport = local_delivery



and this is my local_delivery transport :-

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}}



how can i get the localuser router to fail if the mail directory cannot be found?

when testing on a directory that exists if i do

exim -d -bt fred@???

it finds the correct mail directory and reports it with :-

..
--------> localuser router <--------
local_part=fred domain=mydomain.com
checking domains
cached yes match for +local_domains
cached lookup data = NULL
mydomain.com in "+local_domains"? yes (matched "+local_domains" - cached)
checking require_files
file check: ${perl {get_user_dir}{$local_part}{$domain}}
expanded file: /data/disk00/mail/669/mydomain/650/fred
stat() yielded 0
calling localuser router



and if i check it with a non-existant directory, even though it cannot find the mail directory
it still says it is going to carry on to the localuser router :-

exim -d -bt fred@???

..
--------> localuser router <--------
local_part=fred domain=nosuch.net
checking domains
cached yes match for +local_domains
cached lookup data = NULL
nosuch.net in "+local_domains"? yes (matched "+local_domains" - cached)
checking require_files
calling localuser router






thanks for any help that can point me in the right direction


--


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.