[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Usernames with dots in...

> Unlikely but true.  For various reasons I want usernames of the form
> xxx.yyy.  The trouble is that zmailer 2.99.15/16 get upset because they try
> to map that to a realname and if that fails then to a newsgroup.  By
> lightly hacking rrouter.cf in an obvious way I have got it to work but I
> was wondering if there was a better way to do it.

	Real accounts with dots in them ?  Huh..

> In particular, is there any obvious way to check the validity of a local
> user?  After all, it seems that quite often in the router cf files the
> default delivery is to try to deliver to a local user without checking if
> that user exists.  Then the local delivery agent checks and fails the
> delivery rather than doing it in the router which seems like the obvious
> place.

	Basically to do it we just need to query system for a lookup
	of given user account, however if the database comes over NIS
	or some such, and we try to optimize by keeping db access files
	open all the time, it becomes somewhat erratic in my experience.

	.. and the original system did not do it anyway .. (legacy..)

	By looking into router sources,  getpwnam() library function is
	used in two routines that provide data to script functions:
		login2uid     username
		homedirectory username
	The  login2uid  has its own internal cache, which may cause some
	unexpected problems (at least it is where I placed the blame on
	some such problems a few years back - and I haven't re-checked

	I might do it like this:

	dummy=$(homedirectory "$user") || return (((error nosuchuser ...)))

	Actual test:
	z$ dummy=$(homedirectory foofoofoo) || echo no such user
	no such user
	z$ dummy=$(homedirectory mea) || echo no such user

	Actually to think about it, perhaps before the ".forward"
	checkup is done, lookup for account existence can be done
	with that same routine, AND the result be saved as a base
	for latter checkup of ~user/.forward..  Yes, it should be

> Any thoughts from anyone?
> Simon Brock.

	/Matti Aarnio <mea@nic.funet.fi> <mea@utu.fi>