<?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>Bennyland &#187; smtp</title>
	<atom:link href="http://blog.bennyland.com/tag/smtp/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.bennyland.com</link>
	<description>this server is running in my bedroom - benny’s learning how to run a linux server</description>
	<lastBuildDate>Thu, 06 Jan 2011 16:41:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Forwarding all mail to your ISP&#8217;s smtp server with postfix and CentOS 5.4</title>
		<link>http://blog.bennyland.com/2010/01/18/forwarding-all-mail-to-your-isps-smtp-server-with-postfix-and-centos-5-4/</link>
		<comments>http://blog.bennyland.com/2010/01/18/forwarding-all-mail-to-your-isps-smtp-server-with-postfix-and-centos-5-4/#comments</comments>
		<pubDate>Mon, 18 Jan 2010 19:01:44 +0000</pubDate>
		<dc:creator>benny</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[guide]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[smtp]]></category>

		<guid isPermaLink="false">http://blog.bennyland.com/?p=13</guid>
		<description><![CDATA[I needed to forward all server mails to external email addresses and I had to use my ISP's smtp to do it. This is because everything is blocked by my ISP to combat spammers just making their own smtp server at home and then running it all hours of the day. To do this, you should have postfix installed and running already.

This tutorial will show you how to set up postfix to use your ISP's smtp, and also how to forward internal emails to external accounts.]]></description>
			<content:encoded><![CDATA[<p>I needed to forward all server mails to external email addresses and I had to use my ISP's smtp to do it.  This is because everything is blocked by my ISP to combat spammers just making their own smtp server at home and then running it all hours of the day.  To do this, you should have postfix installed and running already.<span id="more-13"></span></p>
<h3>Setting up Postfix to use your ISP's smtp</h3>
<p>Note: if your ISP requires authentication for smtp, you'll have to do some googleing.  If they don't (mine doesn't) then this will work fine for you.</p>
<pre class="brush: bash; title: ;">vim /etc/postfix/main.cf</pre>
<p>Next, you need to add the relayhost variable, you may have to enclose the domain in brackets, I didn't have to but I've read everywhere that you should:</p>
<pre class="brush: plain; title: ;">relayhost = [your.isps.smtp.com]</pre>
<p>Other items to potentially edit:</p>
<pre class="brush: plain; title: ;">myhostname = your.host.name
mydomain = your.domain
myorigin = $mydomain
inet_interfaces = all
mydestination = $myhostname, localhost.$mydomain, localhost
unknown_local_recipient_reject_code = 550
relay_domains = $mydestination</pre>
<p>Now, restart postfix</p>
<pre class="brush: bash; title: ;">service postfix reload</pre>
<h3>Forwarding name@yourdomain.com to a real e-mail address</h3>
<p>First things first, you need to edit main.cf</p>
<pre class="brush: bash; title: ;">vim /etc/postfix/main.cf</pre>
<p>Next, either add or edit the following lines.  You can add as many domains as you want.  If you followed the <a href="http://www.howtoforge.com/perfect-server-centos-5.4-x86_64-ispconfig-3">Perfect Server</a> tutorial, you'll have all sorts of junk in these variables, just replace them.</p>
<pre class="brush: plain; title: ;">virtual_alias_domains = yourdomain.com yourotherdomain.com.
virtual_alias_maps = hash:/etc/postfix/virtual</pre>
<p>Now, edit the /etc/postfix/virtual file to add your forward rules:</p>
<pre class="brush: bash; title: ;">vim /etc/postfix/virtual</pre>
<p>forward all mail sent to *@yourdomain.com to your@email.com and name@yourotherdomain.com to your@email.com:</p>
<pre class="brush: plain; title: ;">@yourdomain.com your@email.com
name@yourotherdomain.com your@email.com</pre>
<p>Now, restart postfix</p>
<pre class="brush: bash; title: ;">postmap /etc/postfix/virtual
service postfix reload</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.bennyland.com/2010/01/18/forwarding-all-mail-to-your-isps-smtp-server-with-postfix-and-centos-5-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

