Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

redirecting all mail from domain1.com to domain2.com

Status
Not open for further replies.

Pottypotsworth

Programmer
Jul 22, 2002
5
GB
Hi guys i have a slight problem.

I need to direct all mail from one domain to another but i need to retain the user (so the part before the @).

So if someone mails support@domain1.com it needs to be directed to support@domain2.com, or if someone mails advice@domain1.com it needs to goto advice@domain2.com etc etc.

I cracked open virtusetable and put
@domain1.com @domain2.com

I rehashed virtusetable.db and restarted sendmail but it doesn't work. I get a "to many hops" e-mail returned to my e-mail adress which i sent the e-mail from.

if i do @domain1.com bob@domain2.com it works fine, but obviously that doesnt help due to the fact that all mail to domain1.com will only goto bob@domain2.com

I dont know wether it makes any difference but domain2.com is on MDEAMON because the user uses exchange.

I hope this makes sense.

Dean
 
In your example you have:

@domain1.com @domain2.com

Try it without the @ in front of domain2.com
 
I haven't tried it yet, as i have not had time to access the server. But out of interest, what makes you think that will work? Won't sendamail think that domnain2.com is a user?

Just wondering thats all!
 
I tried your idea RhythmAce, but what it did was strip the username out, so the e-mail got redirected simply to @domain2.com so the domain2.com server just bounced it back saying (and rightly so) that there was no username!
 
Try this...

@domain1.com %1@domain2.com

The username part of the input address is passed in the %1 variable, so that %1 in the outbound address is replaced by the username from the input address.


ChrisP ------------------------------------------------------------------------------
If somebody helps you, please click the link in the botton left hand corner that says "Mark this post as a helpful/expert post".
 
O.k i'm still getting permenate delivery failures!

It seems like sendmail is managing to convert the name because i sent to user1@domain1.com which should translate to user1@domain2.com and it has done, but when it gets sent from the sendmail server to the mdeamon server, it seems that the address is just @domain2.com so its bouncing it back :(

here is a snippet of the message!

Return-path: <me@myserver.com>
Received: from me ([100.100.100.100])
by my server ([100.100.100.100])
with SMTP (MDaemon.PRO.v6.0.4.R)
for <user1@domain2.com>; Wed, 07 Aug 2002 11:49:22 +0100
Reply-To: <me@myserver.com>
From: &quot;ME&quot;
To: <user1@domain2.com>
Subject: %1@ test
Date: Wed, 7 Aug 2002 11:40:08 +0100
Message-ID: <000801c23dfe$cce914d0$1001a8c0@chewie>
MIME-Version: 1.0
Content-Type: text/plain;
charset=&quot;iso-8859-1&quot;
Content-Transfer-Encoding: 7bit
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2910.0)
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
Importance: Normal
X-MDRcpt-To: user1@domain2.com
X-MDRemoteIP: 100.100.100.100
X-Return-Path: me@myserver.com
X-MDaemon-Deliver-To: @domain2.com

The interesting thing, is that it HAS changed user1@domain1.comn to user1@domain2.com but it just doesnt get sent, it says...

YOUR MESSAGE WAS NOT DELIVERED!
Failed address: @domain2.com


Any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top