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

Re: exim howto newbie ?



welcome to the EXIM corner of our little dungeon...

On Wed, Sep 20, 2000 at 10:00:27AM +1000, christo wrote:
> when i send mail to :-
> 
> userA@dom-one.com
> userB@dom-two.com
> userC@dom-three.com
> 
> all 3 receives them
> 
> now....if i send emails to userA@dom-two.com or userB@dom-one.com, 
> userA and userB receives this email where they SHOULDNT

it took me an intense 9-hour day after weeks of poking and prodding
to figure this part out-- maybe i can spare you the same anguish...

i've got 14 domains here on my potato box, and this works well for me:

	# mkdir /etc/exim

	# cd !$

	# cat > dom-one.com
		user1     user1
		userUno   userUno
		userPrime userPrim
		^D

	# cat > dom-two.com
		user2   user2
		duo     duo
		pair    pair
		*       systemwonk
		^D

	# cat > dom-twoHMM.com
		*   luckysoul
		^D

	# cat > dom-three.com
		user3     user3
		trois     trois
		triple    triple
		dudethree dudethree
		^D

	# cat > DOMAINS
		# *.domain.name	  /etc/exim/<aliasfile>
		*.dom-one.com:    dom-one.com
		*.dom-uno.com:    dom-one.com

		dom-two.com:      dom-twoHMM.com
		*.dom-two.com:    dom-two.com

		*.dom-three.com:  dom-three.com
		^D

(i'm indenting for clarity, you understand... cut&paste
at your own risk... :)

the /etc/exim/DOMAINS file is a 'table-lookup' sheet relating incoming
email domains to their alias files. you can have several domains 'point'
to one file (see dom-uno and dom-one above) if you like.

in the example above, email to <someone@dom-two.com> would be
referred through the alias file /etc/exim/dom-twoHMM.com, where
email to <someone@www.dom-two.com> would instead wind up using the
/etc/exim/dom-two.com aliases: the first matches dom-two.com
exactly, the second would match *.dom-two.com instead. cool!
(and given the setup for dom-twoHMM.com, all messages wind up
going to 'luckysoul'.)

you can also make sure that you catch undelivered mail to certain
hosts this way: see '* systemwonk' in /etc/exim/dom-two.com above.


here's how you tell exim to use that table-lookup arrangement:

in /etc/exim.conf put

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

and then further down, in the DIRECTORS section BEFORE the /etc/aliases
rule--

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

(if you put this after the /etc/aliases file, then those will override the
domain-specific aliases. if that's what you want, then by all means do so.
configuration files are a pain to figure out, but there's a whole lotta
power in them thar files...)

i predict it'll take three hours of uninterrupted concentration on the
exim.conf possibilities before you grok the lsearch (or any search)
facility -- and once you do, look out!

CAVEAT -- this will get unweildy in a hurry if you have a large number
of users and/or a large number of domains. there are alternatives,
but once you figure out this part, you can probably figure out the
next steps...

/usr/share/doc/exim/exim-uucp.texinfo.gz
/usr/share/doc/exim/filter.txt.gz
/usr/share/doc/exim/README.UPDATING.gz
/usr/share/doc/exim/README.Y2K.gz
/usr/share/doc/exim/changelog.gz
/usr/share/doc/exim/example.conf.gz
/usr/share/doc/exim/mails.gz
/usr/share/doc/exim/spec.txt.gz
/usr/share/doc/exim/copyright
/usr/share/doc/exim/README.IPV6.gz
/usr/share/doc/exim/dbm.discuss.txt.gz
/usr/share/doc/exim/NewStuff.gz
/usr/share/doc/exim/README.gz
/usr/share/doc/exim/README.Debian.gz
/usr/share/doc/exim/changelog.Debian.gz
/usr/share/doc/exim/oview.txt.gz

/usr/share/man/man8/exim.8.gz



Reply to: