[sllug-members]: Mail from localhost delivered to Google Apps with Postfix? Anyone have a solution?

Kevin Pendleton kevin at roundsphere.com
Mon Feb 18 15:40:25 MST 2008


On Sat, Feb 16, 2008 at 2:37 PM, <chad at planetmayfield.com> wrote:
>> On the main domain I host I use Google Apps for email only rather than have
>> to administer a mail server a deal with spam issues, relays, etc..  The
>> problem I am running into is that I need the local mail generated by
>> localhost to be relayed/forwarded to my Google Apps account.
>>     
I'm assuming the problem you are running into is that your hostname of 
your server is the same as your Google Apps account.  So since the 
domain is seen as local, it's trying to deliver it local.  Often it is 
better to have the hostname of your server be some subdomain off of your 
main domain name.  Fro example, instead of naming your server 
planetmayfield.com, name it www.planetmayfield.com if it is a web 
server, etc.  This can also be solved by simply modifying your Postix 
config file main.cf (normally in /etc/postfix/main.cf). Take a look at 
the following settings:

$myhostname = same as above, uncomment it so it doesn't use the hostname 
you assigned your server and change it to something you want to use when 
you want something delivered locally

$mydestination = this is probably the official way to do it.  This 
variable determines what domains postfix considers local.  If you didn't 
change $myhostname like mentioned previously, remove it from this 
variable.  For example, the default reads like this:

mydestination = $myhostname, localhost.$mydomain, localhost

change it to:

mydestination = localhost.$mydomain, localhost

Just remember that if you do it this way, you need to specify localhost 
if you ever want to delivery anything locally.

Once you save your changes, run `postfix reload` to have the new changes 
take effect.

Of course, there's always tons of ways to do things, so you could do 
this through a transport map as well, but I don't think it's necessary 
in this situation.

Good luck and let us know how it goes!

Kevin
http://utahsysadmin.com/






More information about the sllug-members mailing list