Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 9 Apr 1997 08:51:56 -0700 (PDT)
From:      "Jonathan M. Bresler" <jmb>
To:        paul@nation-net.com (Paul Walsh)
Cc:        questions@freebsd.org
Subject:   Re: Sendmail rule help needed
Message-ID:  <199704091551.IAA27616@freefall.freebsd.org>
In-Reply-To: <334B782B.1DAF@nation-net.com> from "Paul Walsh" at Apr 9, 97 10:06:19 am

next in thread | previous in thread | raw e-mail | index | archive | help
Paul Walsh wrote:
> 
> Hi, it's good to be back.
> 
> I am trying to rewrite all mail for a domain abc.co.uk to xyz.co.uk retaining the user part.
> 
> I have a virtualhosts file set up which is working fine for 
> user1@domain1 -> user2@domain2
> domain -> user@domain
> 
> but these existing rules that I have won't map properly for 
> domain1 -> domain2 
> which is what I want!
> 
> S98
> ############################# PW ##########
> # Sendmail for virtual domains PW 4 OCT 1996
> ########################################
> R$+ < @ $+  . >         $: $1 < @ $2 > .
> R$+ < @ $+ > $*         $: $(virtualhosts $1@$2 $: $1 < @ $2 > $3 $)
> R$+ < @ $+ > $*         $: $(virtualhosts $2 $: $1 < @ $2 > $3 $)
> R$+ < @ $* > .          $: $1 < @ $2 . >
> ######################### done PW #########

	are you using m4 to create your .cf files?
	S98 is the result of LOCAL_RULE_0.
	why not use the virtusertable feature?
	ti will reroute mail for user@host to someone@somewhere.
	the mapping is repeated till no additional changes result.
	beware loops!  sendmail s trying after 50 mappings.
	this rewrites the user,host part of the user,host,mailer
	triple only.  

	lookup key is "user@host"
	if that fails
		lookup key is "host"
	if that fails too
		no write takes place.
jmb

> 
> I tried adding:
> R< @ $+ >         $: $(virtualhosts $1 $: < @ $1 > $)
> with a line:
> xyz.com		abc.com 
> in virtualhosts and Cwxyz.com, but it doesn't work ( user not known )
> 
> ... so I added a quick n dirty fix 
> 
> # PW forward vlh.co.uk mail
> R$+ < @ granby.co.uk > $*       $#smtp $: $1 < @ granbyms.demon.co.uk > $2
> 
> which kind of works ( but not for local users) but isn't using virtualhosts.
> 
> Can anybody help? 
> 
> 
> Regards, Paul Walsh
> 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199704091551.IAA27616>