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

So I have some custom VPS which route emails via MX record in DNS. And I need to setup gmail interface via Google Apps - this step and previous are clear. But how can I insert some middle layer, to check emails messages for special words/etc., so something like spam assasin proxy, but custom product.

The question is: How could i setup proxy mail from my server => to proxy server(or application) => to gmail servers?

Thank you, for any help!

share|improve this question
I'm just courious why you are putting a spamfilter infront of GMail. AFAIK Google does some excelent spam checking. – Christopher Perrin Jul 8 '12 at 17:43
"which route emails via MX record in DNS" - is there a different way to route emails? If you already have an MTA then why not filter there - why use an additional component? – symcbean Sep 14 '13 at 22:13

Mailscanner can do the checks that you want to perform.

share|improve this answer
thanks for response, but I'll need to check each email for my custom filters. and I didn't get it, how to setup it before gmail? because gmail is work via mx-record, so its mean that installed mailscanner or whatever else will not got any mail, isn't it? so how do I hack this stuff? thanks. – Eugene Aug 22 '10 at 13:20
You cannot do that if you want to do your own checks then you have to get the mx records to point to you. Then you deliver to gmail – topdog Aug 22 '10 at 13:55
but how do i transfer mail next to gmail server after my proxy to gmail server – Eugene Aug 22 '10 at 14:01
Depends on your proxy, you just need to tell it the final destination is the google server. – topdog Aug 22 '10 at 14:08
can you give me a sample of such configuration or proxy product url, please? – Eugene Aug 22 '10 at 14:19

You need to setup what is called a smarthost on your mail server to point to your proxy which would then send the mail out to gmail. I would need to know what mail server you are using to tell you how to set this up for your particular mta

share|improve this answer
please tell me dear Zypher, my server is running Ubuntu 10.04 – Eugene Mar 20 '11 at 9:58

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.