[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: separate alias/redirect files for different domains using sendmail



On Thu, Oct 05, 2000 at 10:52:48PM +0200, Taco IJsselmuiden wrote:
> Hi All,
> 
> I'm trying to figure out how to be able to use separate alias/redirect
> files for different domains (like a .redirect in their home-dir), so I (as
> admin) don't have to keep updating the aliases, because someone wants an
> extra email-alias for his/her domain, but I can't find anything ;((
> 
> Is it a 'standard' sendmail-config, or do i need an other package.

on my potato box,
	man sendmail
shows
	SYNOPSIS
		exim [options] arguments ...
		mailq [options] arguments ...
		rmail [options] arguments ...
		rsmtp [options] arguments ...
		runq [options] arguments ...
		sendmail [options] arguments ...
so these are all related.

in my /etc/exim.conf i've got

	local_domains = localhost:*dontUthink.com:partial-lsearch;/etc/exim/DOMAINS

and further down in the 'directors' section:

	# check aliases for virtual hosts --
	#	virtual hostname-->alias file mapping is in /etc/exim/DOMAINS
	#	<alias>@<hostname>-->is in /etc/exim/<virtual> from DOMAINS
	#	and global default aliases '*: someone' is possible in each
	#	virtual host alias file, because we use 'search_type=lsearch*'

	virtual_aliases:
		driver = aliasfile
		domains = "partial-lsearch;/etc/exim/DOMAINS"
		file_transport = address_file
		pipe_transport = address_pipe
		file = /etc/exim/${domain_data}
		search_type = "lsearch*"

now, the /etc/exim/DOMAINS file resembles this:

	# *.domain.name			/etc/exim/<aliasfile>
	*.dontuthink.com:		dontuthink
	*.serensoft.com:		serensoft
	*.bucks2browse.com:     bucks2browse
	*.buckstobrowse.com:    bucks2browse

any 'someone@dontuthink.com' address is looked up in the
config file /etc/exim/dontuthink; any email to someone in
the '@buckstobrowse.com' or '@bucks2browse.com' domain
is directed to aliases in the /etc/exim/bucks2browse file.

for instance, /etc/exim/dontuthink could look like this:
	puz:	will
	admin:  will
	kat*:	kat
	sales:  rdt
	*:		will

so mail to kat-bubba@dontuthink.com will go to user 'kat';
mail to dimplemonger@www.dontUthink.com will go to user 'will'
(by default, thanks to the final '*' alias).

--

for your domain-per-user setup (as i gather from your
message) you can instead refer to individual user alias
files:

	# /etc/exim.conf
	virtual_aliases:
		driver = aliasfile
		domains = "partial-lsearch;/etc/exim/DOMAINS"
		file_transport = address_file
		pipe_transport = address_pipe
		# here's the kicker: ###################
		file = /home/${domain_data}/.mail_aliases
		# or whatever you need for your setup###
		search_type = "lsearch*"

cool, eh? (if one of your users doesn't have a matching
.mail_aliases file -- or has a corrupt one -- well, let's
just say you should test for that situation and see what
happens, and how to recover...)

-- 
things are more like they used to be than they are now.

will@serensoft.com *** http://www.dontUthink.com/



Reply to: