On 2001-11-14 at 22:38 +0000, Chris Bunch wrote:
> Fairly standard, I would
> imagine.
Yes, very much so.
> My mailbox is located in /Users/cb/Mail/mbox (cb is my username)
> My email address is chris@???. The default system_aliases director
> correctly resolves chris to cb from /etc/aliases. For single user mode I
> have set user = cb in the system_aliases director. All well and good.
system_aliases should not be handling final delivery. Think of it as
being just a lookup, to figure out which account the alias is for. Any
deliveries should be special-cases (see below).
> But what should I set 'user =" to in the system_aliases director to accept
> mail for any local user? Or is there another solution?
Unless you have any command-pipes, etc, in the alias file, you shouldn't
need a "user =" definition here. This would be for things like a system
box, or some kind of mailing-list manager. Your simple set-up shouldn't
involve any sort of dodgy chicanery like this.
> I have tried a variety of permutations. A logical one (I would have thought)
> would be to set "user = $local_part" but that didn't work: for example with
> mail to kath@??? (username = kb) I get the following debug
> messages:
>
> file lookup required for kath
> in /etc/aliases
> lookup yielded: kb
> LOG: 0 MAIN PANIC
> Failed to find user "kath" from expanded string "$local_part" from the
> system_aliases director
>
> because kath is an alias for user kb
>
> I suspect I'm missing something simple and obvious (and apologise for
> wasting your time if I have), but all help gratefully received.
What you're after is a "localuser" Director, and associated Transport.
localmbox_transport:
driver = appendfile
file = /Users/$local_part/Mail/mbox
delivery_date_add
envelope_to_add
return_path_add
localmbox_director:
driver = localuser
transport = localmbox_transport
There are also "group" and "mode" options for the Transport, which you
might need to fiddle with.
The $local_part is the local part which is _currently_ being attempted.
The system_aliases Director should have already mapped "chris" to "cb"
and "kath" to "kb", leaving the old value in $original_local_part.
Does this make things clearer (and maybe even help)?
--
I don't suffer from insanity. I enjoy every minute of it.