Page 1 of 1

change email address? and reply back

Posted: Tue Oct 31, 2006 8:54 am
by Rickc
Is there a way i can accept an email and forward it on to an address so it looks like it came from another? and then when that person replys to it it sends it back to the orginal address.

eg.

andy@hotmail.com > support@domain.com > support@domain2.com

then

support@domain2.com > support@domain.com > andy@hotmail.com

whist hiding the support@domain2.com address??

cheers

Rick

Posted: Tue Oct 31, 2006 9:13 am
by feyd
You won't be able to hide the originating address absolutely, but for most people it can be hidden. The Reply-To header will tell a compliant email client where to send a reply to.

Posted: Thu Nov 02, 2006 9:43 am
by Rickc
any code out there that lets me do that?
thanks for the reply

Cheers
Rick

Posted: Thu Nov 02, 2006 10:08 am
by Chris Corbyn
Rickc wrote:any code out there that lets me do that?
thanks for the reply

Cheers
Rick
Actually this can be entirely hidden but you'll need control over the system filter of the mail server to do it.

Set up a pipe to deliver *all* mail sent to support@domain.tld elsewhere.

Set up the mail client for the person reading email from support@domain2.tld so it uses the same MX server to relay the mail as where it came from (i.e. the MX for support@domain.tld).

Set up a filter which checks if the sender address is "support@domain2.tld" via this relay, remove all headers for support@domain2.tld and replace them with support@domain.tld. The recipient is completely unaware.

It sounds complex (and yes it's a bit hairy) but really it's quite simple to do if and only if you have access to the mail server configuration.

Posted: Thu Nov 02, 2006 12:39 pm
by _ca_
Rickc wrote:any code out there that lets me do that?
This should do this: (not tested, sorry)

Code: Select all

$headers  = "From: Him <him@example.com>";
$headers .= "Reply-To: Me <me@example.com>\n";
$headers .= "Return-Path: Me <me@example.com>\n";

mail('someone@example.com', 'subject', 'body', $headers);
Chris

Posted: Thu Nov 02, 2006 1:23 pm
by Chris Corbyn
_ca_ wrote:
Rickc wrote:any code out there that lets me do that?
This should do this: (not tested, sorry)

Code: Select all

$headers  = "From: Him <him@example.com>";
$headers .= "Reply-To: Me <me@example.com>\n";
$headers .= "Return-Path: Me <me@example.com>\n";

mail('someone@example.com', 'subject', 'body', $headers);
Chris
Yeah but that won't hide the address and it won't keep the reply-to header in subsequent. It will make the reply come back to your address for that email though :)