<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Blog of an Egyptian Songbird &#187; Postfix</title>
	<atom:link href="http://blog.twinklesprings.com/tag/postfix/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.twinklesprings.com</link>
	<description>A translation of my mind's short circuits.</description>
	<lastBuildDate>Thu, 05 Mar 2009 20:57:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Remote Mail Delivery for Google Apps and Postfix Mail Server</title>
		<link>http://blog.twinklesprings.com/2008/03/27/remote-mail-delivery-for-google-apps-and-postfix-mail-server/</link>
		<comments>http://blog.twinklesprings.com/2008/03/27/remote-mail-delivery-for-google-apps-and-postfix-mail-server/#comments</comments>
		<pubDate>Thu, 27 Mar 2008 12:57:04 +0000</pubDate>
		<dc:creator>Shadi Almosri</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[CentOS]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[Postfix]]></category>
		<category><![CDATA[relay]]></category>

		<guid isPermaLink="false">http://blog.twinklesprings.com/2008/03/27/remote-mail-delivery-for-google-apps-and-postfix-mail-server/</guid>
		<description><![CDATA[After stumbling upon this issue various times I’ve decided to finally resolve it.
The Issue:
If you have a domain hosted on a server, but you have setup Google Apps for your domain to use the Gmail style email system for your domain, then you might notice a problem with sending mail to your own domain.
The problem [...]]]></description>
			<content:encoded><![CDATA[<p>After stumbling upon this issue various times I’ve decided to finally resolve it.</p>
<p><strong>The Issue:</strong></p>
<p>If you have a domain hosted on a server, but you have setup Google Apps for your domain to use the Gmail style email system for your domain, then you might notice a problem with sending mail to your own domain.</p>
<p>The problem is due to the domains hosted on the server telling your SMTP server that this server is the final destination for the email and all email will be sent using the local delivery methods on Linux.</p>
<p>To force your mail server (in this case Postfix) to relay your emails to the Google mail servers, then you will need to change the settings in the transport file:</p>
<p><code><br />
[12:40:21] [root@localhost /etc/postfix]# cd /<br />
[12:46:33] [root@localhost /]# cd /etc/postfix/<br />
[12:46:39] [root@localhost /etc/postfix]# nano transport<br />
</code></p>
<p>in the transport file you might see a line similar to:</p>
<p><code><br />
mydomain.com    maildrop:<br />
</code></p>
<p>Where &#8220;mydomain.com&#8221; is the domain you have hosted on the server.</p>
<p>To fix the domain relay issue to use the MX records at Google, you will need to change the above line to:</p>
<p><code><br />
mydomain.com relay:ASPMX.L.GOOGLE.com<br />
</code></p>
<p>if you have multiple domains on the server, of which some could be a mix of google hosted or locally hosted (for email), then you can simply set the file to look something like:</p>
<p><code><br />
mydomain.com		relay:ASPMX.L.GOOGLE.com<br />
mygoogledomain.com	relay:ASPMX.L.GOOGLE.com<br />
mylocaldomain.com	maildrop:<br />
</code></p>
<p>Then run the commands:</p>
<p><code><br />
[12:47:43] [root@localhost /etc/postfix]# postmap /etc/postfix/transport<br />
[12:47:44] [root@localhost /etc/postfix]# /etc/init.d/postfix reload<br />
Reloading postfix:                                         [  OK  ]<br />
[12:47:44] [root@localhost /etc/postfix]#<br />
</code></p>
<p>You can now test your emails by sending a mail on the server to a local domain, you can do it using a simple PHP script:</p>
<p>&lt; ?php<br />
mail(&#8220;youremail@yourdomain.com&#8221;, &#8220;test &#8211; mailserver&#8221;, &#8220;Message body&#8221;);<br />
?&gt;</p>
<p>If at any time you wish to see what postfix is doing, then you can keep an eye on your log file:</p>
<p><code><br />
[12:53:40] [root@localhost /etc/postfix]# tail -f /var/log/maillog<br />
</code></p>
<p>This will stream the maillog file and show you what postfix is doing.</p>
<p>[NOTE: This was carried out and tested on CentOS 5.1 but it should work on any Postfix Linux install]</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.twinklesprings.com/2008/03/27/remote-mail-delivery-for-google-apps-and-postfix-mail-server/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>
