<?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>Hack Admin &#187; relay</title>
	<atom:link href="http://www.hackadmin.com/tag/relay/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.hackadmin.com</link>
	<description></description>
	<lastBuildDate>Tue, 16 Mar 2010 21:31:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How To Make Sendmail Relay Everything</title>
		<link>http://www.hackadmin.com/2009/07/10/how-to-make-sendmail-relay-everything/</link>
		<comments>http://www.hackadmin.com/2009/07/10/how-to-make-sendmail-relay-everything/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 23:44:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Education]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Workaround]]></category>
		<category><![CDATA[directive]]></category>
		<category><![CDATA[email]]></category>
		<category><![CDATA[email relay]]></category>
		<category><![CDATA[inbound email]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[relay]]></category>
		<category><![CDATA[relay email]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[sendmail]]></category>
		<category><![CDATA[smtp]]></category>

		<guid isPermaLink="false">http://www.hackadmin.com/?p=146</guid>
		<description><![CDATA[I knew I had done this before, but all the explanations I found today were amazingly long and convoluted, which is not what I remembered from the first go around.
Basically, I wanted sendmail to take all inbound email and immediately relay it to another host.  In my situation it makes sense because my servers [...]]]></description>
			<content:encoded><![CDATA[<p>I knew I had done this before, but all the explanations I found today were amazingly long and convoluted, which is not what I remembered from the first go around.</p>
<p>Basically, I wanted sendmail to take all inbound email and immediately relay it to another host.  In my situation it makes sense because my servers have no direct access to the outside world (security thing).  But in reality with the complexities involved in sending email these days, why bother setting up every host or every NAT to be capable of dependably delivering email.</p>
<p>So the solution is, setup one host that you know is a good mail host, and one host that you can monitor for throughput, then point all your other hosts at it for delivery.  Piece of cake right?  Odd that it took me 30 minutes and then a final trip to the sendmail documentation to find it.</p>
<p><span id="more-146"></span>In the end we&#8217;re talking about 1 line in your sendmail.mc (I&#8217;ve consistently found that most of life&#8217;s problems can be solved with 5 to 50 characters in the right text file).</p>
<p>At any rate, the directive you are looking for is:</p>
<p><code>define(`SMART_HOST', `smart.host.com')dnl</code></p>
<p>Just replace &#8220;smart.host.com&#8221; with the smtp server you intend to use as the relay.</p>
<p>For those of you who don&#8217;t use the sendmail.mc, you need to modify the DS variable in your sendmail.cf (but really, find something better to do with your time than edit that file).</p>
<p>For all you sendmail.mc users, once that line is in place, run a &#8220;make&#8221; in your /etc/mail directory and then restart sendmail.</p>
<p>Actually, I was using this mess of a line to test:</p>
<p><code>touch /tmp/mail.txt; /etc/init.d/sendmail restart ; mail -s "Test2" me@myemail.com &lt; /tmp/mail.txt ; tail -f /var/log/maillog</code></p>
<p>You&#8217;ll come up in a tail of maillog and you should watch for the relay host accepting your message.  If it doesn&#8217;t get delivered, it&#8217;s time to look at the relay server.</p>
<p>That is all, have fun!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackadmin.com/2009/07/10/how-to-make-sendmail-relay-everything/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>When to use MySQL BlackHole Tables</title>
		<link>http://www.hackadmin.com/2008/06/14/when-to-use-mysql-blackhole-tables/</link>
		<comments>http://www.hackadmin.com/2008/06/14/when-to-use-mysql-blackhole-tables/#comments</comments>
		<pubDate>Sat, 14 Jun 2008 18:09:32 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Database]]></category>
		<category><![CDATA[Maintenance]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[BlackHole Table Type]]></category>
		<category><![CDATA[data dump]]></category>
		<category><![CDATA[data import]]></category>
		<category><![CDATA[innodb]]></category>
		<category><![CDATA[master]]></category>
		<category><![CDATA[mysql server]]></category>
		<category><![CDATA[relay]]></category>
		<category><![CDATA[slave]]></category>
		<category><![CDATA[table types]]></category>

		<guid isPermaLink="false">http://www.hackadmin.com/2008/06/14/when-to-use-mysql-blackhole-tables/</guid>
		<description><![CDATA[We read about the black hole table type a long time ago and it&#8217;s kind of been a running joke &#8211; why in the hell would somebody want to insert into a black hole?  Many times it&#8217;s been suggested as the solution to all of our data problems&#8230; Just swap out all the InnoDB [...]]]></description>
			<content:encoded><![CDATA[<p>We read about the black hole table type a long time ago and it&#8217;s kind of been a running joke &#8211; why in the hell would somebody want to insert into a black hole?  Many times it&#8217;s been suggested as the solution to all of our data problems&#8230; Just swap out all the InnoDB tables for black hole and ta daaa!!!  No more capacity issues.</p>
<p>So as you might guess it was merely coincidence when we discovered it&#8217;s functionality.  Here&#8217;s the scenario:</p>
<p><span id="more-10"></span>1 DRBD/HA Master MySQL Server<br />
1 DRBD/HA Relay Slave<br />
20 Standalone Slaves</p>
<p>We found with one of our applications that it made alot of sense to keep some tables local and pull some from the master.  The tables that were kept locally on the 20 web serving boxes are rolled up every 10 minutes and their data is sent on for processing.  The tables that are replicated are slave to the Relay Slave, our middle man.</p>
<p><img src="http://www.hackadmin.com/wp-content/uploads/2008/06/bh.png" alt="bh.png" /></p>
<h3>So where does black hole fit in?</h3>
<p>We actually figured it out on the initial import of data.  The beginning database size was around 2GB.  We did the full import to the master and at the time, the relay slave was configured with InnoDB tables.  In addition, we were doing the dump as data infile.   Using data infile in a replication scenario works as follows.</p>
<ol>
<li>The entire file is imported to the master.</li>
<li>Once the file is completed on the master, the relay slave then begins to import the data.</li>
<li>Once the relay slave has completed the file, then the slaves begin to load the data.</li>
</ol>
<p>In our case these files were quite large.  What we discovered was, for each file we were going to have a hella long wait before it every got to the slaves (which is where we actually needed the data).  The solution?  Don&#8217;t write the data to the middle man.  Since binloging is enabled on the relay slave, all of the associated SQL commands are being passed from the Master to the Relay Slave.  Since we never planned on using the Relay Slave in any capacity other than passing on data, there&#8217;s no need to write the commands to disk.  Hence, Black Hole.  All of the SQL replication commands are executed on the Relay Slave, but the are basically sent to /dev/null so you save the write time.</p>
<p>The utility of this setup really stood out when using data infile because of the size of the files, it was really easy to see the lag in the middle.  It will probably not be as important with standard inserts and updates to the master as those happen rather quickly.  However, in the event of a problem, should we have to restore a table or whatever, we know moving forward we are going to save that write time in the middle and possible spare some downtime.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.hackadmin.com/2008/06/14/when-to-use-mysql-blackhole-tables/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

