Re: [Exim] Newbie Config Problem

Pàgina inicial
Delete this message
Reply to this message
Autor: Mark Hynes
Data:  
A: Steve Manning
CC: exim-users
Assumpte: Re: [Exim] Newbie Config Problem
On Sep 28, Steve Manning wrote:
> OK I've successfully compiled and tested 4.10 using MailDirs but I have
> a small problem which I can't seem to overcome.
>
> My MailDir folders are by username in the form
> /home/vmail/maildirs/'username'/. My config is based upon the default
> installation. If I leave the 'check_local_user' in the 'localuser:'
> router the transport attempts to deliver to /home/'username' even though
> the directory in the transport is set correctly. If I disable the
> 'check_local_user' in the router the transport delivers correctly.
>
> This is ok but it does mean that if the user doesn't exist a folder is
> created in the MailDirs for the non-existant user and the mail is
> delivered into it although its never seen. I'm hoping I've overlooked
> something obvious but so far I can't track it down. How can I deliver
> into the specified directory but only to existing users?


As they're (presumably) not system (/etc/passwd) users you need to use
some other way of determining if they're valid or not. There's numerous
ways you could do this - the simplest probably adding something like
"local_parts = list : of : usernames" to your router, or these could
come from a file list of users, eg
"local_parts = /a/file/with/a/listofusernames",
or any other type of Exim lookup type.

You could also only deliver the mail if the user's directory already
exists. If I remember rightly, some time ago a "directory list" type
lookup was written (by Matthew Byng-Maddick I think?), but I can't
find this with a quick look, although a better search of the docs
than I've done would probably find out more.

Hope this helps.

Best regards,
Mark


> For reference the config parts look like this:
>
> #### Router Part ####
>
> localuser:
>     driver = accept
>     check_local_user    # disable this for the maildirs to work
>     transport = local_delivery

>
> #### Transport Part ####
>
> local_delivery:
>     driver = appendfile
>     maildir_format = true
>     directory = /home/vmail/maildirs/${local_part}
>     user = vmail
>     delivery_date_add
>     envelope_to_add
>     return_path_add


--
| Mark Hynes           mark.hynes@??? |
| Systems Developer   http://www.uk.easynet.net/ |
| Easynet Ltd   --   a part of Easynet Group plc |