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

Re: debian-user: exim, unknown user.



On Thu, Oct 12, 2000 at 03:09:42PM +1100, Brendan J Simon wrote:
> I have setup a mail server using exim.  I have it working pretty well,
> but I can't figure out how to send mail for non existant users to a real
> user.  eg. someone@my.com doesn't exist so I would like all mail sent to
> this address to be forwarded to another account (eg. me@my.com).  I'd
> appreciate it if someone could point me in the right direction.

if you have /etc/aliases, just have the last 'alias' be something
like
	*: fail-safe@mydomain.org

so that mail that doesn't go to anyone else in particular will wind
up going to user 'fail-safe'...

this works via exim's alias director facility which looks something
like this:

	system_aliases:
	  driver = aliasfile
	  file_transport = address_file
	  pipe_transport = address_pipe
	  file = /etc/aliases
	  search_type = lsearch

to have virtual domains on your box (where several domain names are
attached to your solo IP number, as is the case with me) you can have
per-domain aliases, like this:

	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*"

here, the /etc/exim/DOMAINS file is a list of domain/filename pairs:

	*.dontuthink.com:		dontuthink
	*.bucks2browse.com:		bucks2browse
	*.buckstobrowse.com:	bucks2browse

if the domain-part of a message (@somewhere.org) matches a pattern on
the left, the result on the right is returned into the $domain_data
variable. note that several 'domains' can share a file, as is shown
here (bucks2browse, with a digit, and bucksTObrowse, without).

then, the line

		file = /etc/exim/${domain_data}

tells exim to look in the file /etc/exim/bucks2browse (for example)
for user-level aliases, as in

	b2b:	wdt
	gotrox:	will
	kat*:	kat
	*:		rdt

so email to kat@buckstobrowse.com or kat-o-nine-tails@bucks2browse.com
will both get to user 'kat', for example, and anything that doesn't
go to anyone else in particular will go to user 'rdt'.

if you put this virtual-alias director BEFORE the system alias director,
then the virtual aliases will override the system aliases (sequence matters).
if you want system aliases to override domain-specific aliases, put the
virtual section AFTER the system alias section.

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

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



Reply to: