Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a server setup to use exim4 and google apps as my smarthost. But I get errors when the to address is not the one I use to authenticate to google and it seems to drop all return addresses that are not the one it uses to authenitcate.

Example: On the contact form of my server a user sets as their return address and uses the form to send a message.

I get an email sent to the admin's address but the return address is also now I have no idea of the return address the user set on the form.

I get around this by putting a bad email address in the form's default so Exim4 sends an error message to with the user's email in the debug info.

Clearly I either have it set up wrong or do not understand how smarthosts work (probably both).

share|improve this question

If you use Google as a smarthost, they will set the From: address to the address you used to authenticate to Google. They do this on purpose, presumably to prevent spam. If you need a smarthost to forward your mail without altering your headers, I recommend Mailhop Outbound - I used them before and never had any issues...

share|improve this answer

As the poster mentions above, Google definitely will be restricting the envelope sender and the header From, or else it would lead to widespread abuse.

This problem can solved at a couple of other places, one is your form script, where you can add the form sender in the data itself or else if you want to solve this in exim, I would suggest you write a system filter using the exim filter language which would strip out the From and envelope sender and put in the correct email address for the From and add the form email in a header like X-Form-Submitter-Email.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.