Forward custom domain email to Gmail and the other way round

0

I'm aware there have been multiple question asked on SX about this (e.g. https://webmasters.stackexchange.com/questions/50808/how-to-forward-emails-to-my-custom-domain-to-my-gmail-account), and I know how to redirect emails from my own domain to my Google account.

The question is, can this be done the other way round? For example: I own the domain example.com and have a catch-all redirect to me@gmail.com. foo@xyz.com sends an email to bar@example.com, and the message is forwarded to my Gmail account. But then, I respond to the message; when my response shows up in foo@xyz.com's inbox, I would like it to appear to have been sent by whatever address the sender originally used - in this case, bar@example.com instead of me@gmail.com.

Is this possible?

user4520

Posted 2016-09-29T18:13:46.447

Reputation: 183

Answers

2

The "From" header is set by the MUA (i.e. your mail program), meaning you can most likely put there whatever you please.

If you use the standard GMail client, i.e. the web interface, you must live with the settings provided there. If on the other hand you use another client, such as e.g. Thunderbird or another web interface connecting via IMAP/SMTP you have wiggle room. Many mail programs are scriptable (or at least "hackable") - you would need to persuade it to use the original "To:" header as basis for the new "From:" header, which should be quite doable if you use one of the open-source web clients.

Another way would be a dummy SMTP server, that just manipulates the headers and then passes the result to Google's SMTP server.

Eugen Rieck

Posted 2016-09-29T18:13:46.447

Reputation: 15 128

That thought crossed my mind, but if I tell Gmail's SMTP server MAIL FROM bar@example.com, will it not reject the message? I think some SMTP servers sanity-check outgoing mail and Google most definitely would. – user4520 – 2016-09-30T08:29:20.467

I am not talking of the STMP "MAIL FROM" command, but the RFC822 "From:" Header. They can (and often will) differ. – Eugen Rieck – 2016-09-30T10:20:14.640

Okay, thank you, I'll see if this is a viable option. – user4520 – 2016-09-30T13:46:44.263

I'm sure you've figured this out by now - but even in Gmail web UI you can add other 'send from' addresses, and handily set it to default to whichever was the 'to' address. – OJFord – 2017-01-15T12:29:38.643