blog

Tell postfix not to send email to local

Posted 13.07.2009

We want to config the server can only send emails, can NOT receive emails from local or remote. Because our domain is pointed to this server, But our email server is on Google Enterprise. So before If we want to send email from the server, It first looks up locally, and send to local directly, So emails never get reach to Google.

I tried: http://www.postfix.org/faq.html#null_client But I seems not work.

After check out the postfix log:

Even you set

local_transport = error:local delivery is disabled
But when you have aliasmaps, aliasdatabase, virtualaliasmaps. Postfix will still try to find the alias name in local. So it fails when it can not find it.

main.cf

master.cf

And Another thing, make sure your hostname is NOT your domain. because It will check hostname first and mx record? I guess.

Name *Please use your real name
Email *Required. Will not be published
Website

That's all for now. This article brought to you by The Plant, makers of Joblet, PiqShare,

and many other fine web apps and content management systems.

Pick up our RSS feed while you are here.

by
Felix Sun
no picture
Felix is Director of The Plant's China branch and technology lead and mixes pragmatism and creativity to find solutions to our technological challenges. In his free time Felix develops language learning tools and money machines (link and patent pending).