<?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>vint.ca</title>
	<atom:link href="http://vint.ca/feed/" rel="self" type="application/rss+xml" />
	<link>http://vint.ca</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Thu, 02 Sep 2010 13:49:41 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Change the default &#8220;View Source&#8221; application in Firefox</title>
		<link>http://vint.ca/2010/09/change-the-default-view-source-application-in-firefox/</link>
		<comments>http://vint.ca/2010/09/change-the-default-view-source-application-in-firefox/#comments</comments>
		<pubDate>Thu, 02 Sep 2010 13:49:41 +0000</pubDate>
		<dc:creator>Paul Vint</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://vint.ca/2010/09/change-the-default-view-source-application-in-firefox/</guid>
		<description><![CDATA[I find I&#8217;m constantly using the &#8220;View Source&#8221; option in Firefox while working on sites, but the default viewer isn&#8217;t the best.
To configure Firefox so it&#8217;ll use a different viewer, do the following:
1. In Firefox, enter &#8220;about:config&#8221; in the address bar (if you get a warning about dragons, heed it, but continue)
2. type &#8220;view&#8221; in [...]]]></description>
			<content:encoded><![CDATA[<p>I find I&#8217;m constantly using the &#8220;View Source&#8221; option in Firefox while working on sites, but the default viewer isn&#8217;t the best.</p>
<p>To configure Firefox so it&#8217;ll use a different viewer, do the following:<br />
1. In Firefox, enter &#8220;about:config&#8221; in the address bar (if you get a warning about dragons, heed it, but continue)<br />
2. type &#8220;view&#8221; in the Filter field<br />
3. Double-click on &#8220;view_source.editor.path&#8221; and enter the path to the editor you desire (I used /usr/bin/kate)<br />
4. Double-click &#8220;view_source.editor.external&#8221; to set it to &#8220;True&#8221;<br />
5. Restart Firefox</p>
<div class='wp_likes' id='wp_likes_post-226'><a class='like' href="javascript:wp_likes.like(226);" title='' ><img src="http://vint.ca/wordpress/wp-content/plugins/wp-likes/images/like.png" alt='' border='0'/>Like</a><span class='text'></span>
<div class='unlike'><a href="javascript:wp_likes.unlike(226);">Unlike</a></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://vint.ca/2010/09/change-the-default-view-source-application-in-firefox/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What&#8217;s My IP Address?</title>
		<link>http://vint.ca/2010/08/whats-my-ip-address/</link>
		<comments>http://vint.ca/2010/08/whats-my-ip-address/#comments</comments>
		<pubDate>Tue, 31 Aug 2010 18:54:41 +0000</pubDate>
		<dc:creator>Paul Vint</dc:creator>
				<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://vint.ca/?p=218</guid>
		<description><![CDATA[Your IP address is: 38.107.191.89

Like
Unlike

]]></description>
			<content:encoded><![CDATA[<p>Your IP address is: 38.107.191.89
</p>
<div class='wp_likes' id='wp_likes_post-218'><a class='like' href="javascript:wp_likes.like(218);" title='' ><img src="http://vint.ca/wordpress/wp-content/plugins/wp-likes/images/like.png" alt='' border='0'/>Like</a><span class='text'></span>
<div class='unlike'><a href="javascript:wp_likes.unlike(218);">Unlike</a></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://vint.ca/2010/08/whats-my-ip-address/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fade-in popup window example in Javascript</title>
		<link>http://vint.ca/2010/08/fade-in-popup-window-example-in-javascript/</link>
		<comments>http://vint.ca/2010/08/fade-in-popup-window-example-in-javascript/#comments</comments>
		<pubDate>Sun, 29 Aug 2010 13:37:42 +0000</pubDate>
		<dc:creator>Paul Vint</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://vint.ca/2010/08/fade-in-popup-window-example-in-javascript/</guid>
		<description><![CDATA[// Browser safe opacity handling function
function setOpacity( divid, value ) {  
 document.getElementById( divid ).style.opacity = value / 10;
 document.getElementById( divid ).style.filter = 'alpha(opacity=' + value * 10 + ')';
}
function fadeInMyPopup( divid ) {
  for( var i = 0 ; i ]]></description>
			<content:encoded><![CDATA[<p><script type='text/javascript'>
// Browser safe opacity handling function
function setOpacity( divid, value ) {  
 document.getElementById( divid ).style.opacity = value / 10;
 document.getElementById( divid ).style.filter = 'alpha(opacity=' + value * 10 + ')';
}
function fadeInMyPopup( divid ) {
  for( var i = 0 ; i <= 100 ; i++ )
  setTimeout( 'setOpacity("' + divid + '", ' + (i / 10) + ')' , 8 * i );
}
function fadeOutPopup( divid ) {
 for( var i = 0 ; i <= 100 ; i++ ) {
   setTimeout( 'setOpacity("' + divid + '", ' + (10 - i / 10) + ')' , 8 * i );
 }
 setTimeout('closeMyPopup( divid )', 800 );
}
function closeMyPopup( divid ) {
 document.getElementById( divid ).style.display = "none";
}
function launchMyPopup( divid ) {
 setOpacity( divid, 0 );
 document.getElementById( divid ).style.display = "block";
 fadeInMyPopup( divid );
}
</script></p>
<div id='popup1' name='popup1' style='width: 380px; height: 300px; display:none; position: absolute; top: 130px; left: 80px;'>
<table width='380' cellpadding='0' cellspacing='0' border='0'>
<tr>
<td><img height='23' width='356' src='/images/menubar_bg.png'></td>
<td><a href='javascript:fadeOutPopup("popup1");'><img height='23' width='24' src='/images/window-close.png' border='0'></a></td>
</tr>
<tr>
<td colspan='2' style='padding: 5px 10px;  vertical-align: text-top; background: url("/images/popup_body.png") no-repeat top left; width: 380px; height: 277px;'>
This is a test of the emergency pop up system.<br />
If this were an actual emergency, you'd have been trampled. <img src='http://vint.ca/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />
</td>
</tr>
</table>
</div>
<input type='submit' onClick="launchMyPopup('popup1')" value=' Launch Popup1! '>
<p>Source code:</p>
<pre name="code" class="javascript">
<script type='text/javascript'>
// Browser safe opacity handling function
function setOpacity( divid, value ) {  
 document.getElementById( divid ).style.opacity = value / 10;
 document.getElementById( divid ).style.filter = 'alpha(opacity=' + value * 10 + ')';
}
function fadeInMyPopup( divid ) {
  for( var i = 0 ; i <= 100 ; i++ )
  setTimeout( 'setOpacity("' + divid + '", ' + (i / 10) + ')' , 8 * i );
}
function fadeOutPopup( divid ) {
 for( var i = 0 ; i <= 100 ; i++ ) {
   setTimeout( 'setOpacity("' + divid + '", ' + (10 - i / 10) + ')' , 8 * i );
 }
 setTimeout('closeMyPopup( divid )', 800 );
}
function closeMyPopup( divid ) {
 document.getElementById( divid ).style.display = "none";
}
function launchMyPopup( divid ) {
 setOpacity( divid, 0 );
 document.getElementById( divid ).style.display = "block";
 fadeInMyPopup( divid );
}
</script>
<div id='popup1' name='popup1' style='width: 380px; height: 300px; display:none; position: absolute; top: 130px; left: 80px;'>
<table width='380' cellpadding='0' cellspacing='0' border='0'>
<tr>
<td><img height='23' width='356' src='/images/menubar_bg.png'></td>
<td><a href='javascript:fadeOutPopup("popup1");'><img height='23' width='24' src='/images/window-close.png' border='0'></a></td>
</tr>
<tr>
<td colspan='2' style='padding: 5px 10px;  vertical-align: text-top; background: url("/images/popup_body.png") no-repeat top left; width: 380px; height: 277px;'>
This is a test of the emergency pop up system.
If this were an actual emergency, you'd have been trampled. <img src='http://vint.ca/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />
</td>
</tr>
</table>
</div>
<input type='submit' onClick="launchMyPopup('popup1')" value=' Launch Popup1! '> </pre>
<p>You can have multiple popups on one page simply by changing the DIV id and setting the calls to fadeInPopup() and launchMyPopup() accordingly.</p>
<div class='wp_likes' id='wp_likes_post-151'><a class='like' href="javascript:wp_likes.like(151);" title='' ><img src="http://vint.ca/wordpress/wp-content/plugins/wp-likes/images/like.png" alt='' border='0'/>Like</a><span class='text'></span>
<div class='unlike'><a href="javascript:wp_likes.unlike(151);">Unlike</a></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://vint.ca/2010/08/fade-in-popup-window-example-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>.htaccess Redirect to a new directory</title>
		<link>http://vint.ca/2010/08/htaccess-redirect-to-a-new-directory/</link>
		<comments>http://vint.ca/2010/08/htaccess-redirect-to-a-new-directory/#comments</comments>
		<pubDate>Fri, 27 Aug 2010 20:35:40 +0000</pubDate>
		<dc:creator>Paul Vint</dc:creator>
				<category><![CDATA[Linux Reference]]></category>

		<guid isPermaLink="false">http://vint.ca/?p=84</guid>
		<description><![CDATA[I recently found I wanted to move some data on my Apache webserver from one directory to another, and didn&#8217;t want to muck around with symbolic links (trying to keep the webspace clean and tidy), but also wanted to ensure that links to these items and searches would still find them.
The answer? .htaccess file and [...]]]></description>
			<content:encoded><![CDATA[<p>I recently found I wanted to move some data on my Apache webserver from one directory to another, and didn&#8217;t want to muck around with symbolic links (trying to keep the webspace clean and tidy), but also wanted to ensure that links to these items and searches would still find them.</p>
<p>The answer? .htaccess file and Redirect!</p>
<p>For example, say you moved the /photos directory on your webserver to /media/photos you could do the following to ensure that old links work:</p>
<p>In the .htaccess file in your webserver&#8217;s root directory, add the following line:<br />
<code>Redirect permanent /photos/ /media/photos</code></p>
<p>Shazam! http://yourserver/photos/whatever.jpeg will redirect to http://yourserver/media/photos/whatever.jpeg</p>
]]></content:encoded>
			<wfw:commentRss>http://vint.ca/2010/08/htaccess-redirect-to-a-new-directory/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Online DNS Lookup (MX or A Records)</title>
		<link>http://vint.ca/2010/08/online-dns-lookup-mx-or-a-records/</link>
		<comments>http://vint.ca/2010/08/online-dns-lookup-mx-or-a-records/#comments</comments>
		<pubDate>Wed, 25 Aug 2010 15:25:24 +0000</pubDate>
		<dc:creator>Paul Vint</dc:creator>
				<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://vint.ca/wordpress/?p=70</guid>
		<description><![CDATA[ 
Lookup A records (IP lookup), MX records (Mail eXchanger), and more for a domain  (ie: dig).

Enter Domain: 




Results:
&#160;

]]></description>
			<content:encoded><![CDATA[<p> <SCRIPT TYPE="text/javascript" SRC="http://www.vint.ca/js/replaceDivPhp.js"></SCRIPT><br />
Lookup A records (IP lookup), MX records (Mail eXchanger), and more for a domain  (ie: dig).<br />
<DIV ID="nslookup" ><FORM NAME="dns"><br />
Enter Domain: <INPUT TYPE="text" NAME="domain" SIZE="32"><br />
<INPUT TYPE="hidden" NAME="type" VALUE="ANY"><br />
<INPUT TYPE="button" VALUE="Lookup"  onClick="replaceDivPHP('dnsresults','/lib/dig.php?domain=' + document.dns.domain.value + '&#038;type=' + document.dns.type.value)"><br />
</FORM><br />
</DIV><br />
Results:<br />
<DIV ID="dnsresults" STYLE=" background-color: #dddddd; width= 100%;">&nbsp;</DIV><br />
<BR></p>
]]></content:encoded>
			<wfw:commentRss>http://vint.ca/2010/08/online-dns-lookup-mx-or-a-records/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pronounceable Password Generator</title>
		<link>http://vint.ca/2010/08/pronounceable-password-generator-2/</link>
		<comments>http://vint.ca/2010/08/pronounceable-password-generator-2/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 15:17:10 +0000</pubDate>
		<dc:creator>Paul Vint</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[passwords]]></category>

		<guid isPermaLink="false">http://vint.ca/wordpress/?p=36</guid>
		<description><![CDATA[Here&#8217;s a simple online password generator &#8211; I&#8217;ll likely add some more features, but it works. You can select the style of password from &#8220;_Lf?^x)p&#8221; gobbledeegook to &#8220;maliLulu&#8221; pronounceable (and easier to remember) styles.
These passwords are generated using passook.
 

Number of passwords: 
Level of pronouncability:1 &#8211; Ex: &#8220;_Lf?^x)p&#8221; (Least Pronounceable)
      [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a simple online password generator &#8211; I&#8217;ll likely add some more features, but it works. You can select the style of password from &#8220;_Lf?^x)p&#8221; gobbledeegook to &#8220;maliLulu&#8221; pronounceable (and easier to remember) styles.<br />
These passwords are generated using <a href="http://github.com/mackers/passook">passook</a>.<br />
 <SCRIPT TYPE="text/javascript" SRC="http://www.vint.ca/js/replaceDivPhp.js"></SCRIPT><br />
<DIV ID="passForm" ><FORM NAME="pass"><br />
Number of passwords: <INPUT TYPE="text" NAME="n" SIZE="4" VALUE="10"><br />
<BR>Level of pronouncability:<SELECT NAME="p"><OPTION VALUE=1>1 &#8211; Ex: &#8220;_Lf?^x)p&#8221; (Least Pronounceable)</OPTION><br />
        <OPTION VALUE=2>2 &#8211; Ex: &#8220;ngomZol3&#8243;</OPTION><br />
        <OPTION VALUE=3 SELECTED="selected">3 &#8211; Ex: &#8220;judO6saM&#8221;</OPTION><br />
        <OPTION VALUE=4>4 &#8211; Ex: &#8220;haffBab0&#8243;</OPTION><br />
        <OPTION VALUE=5>5 &#8211; Ex: &#8220;maliLulu&#8221; (Most Pronounceable)</OPTION><br />
</SELECT><br />
<INPUT TYPE="button" VALUE="Generate"  onClick="replaceDivPHP('tmp','/lib/passook.php?n=' + document.pass.n.value + '&#038;p=' + document.pass.p.value)"><br />
</FORM><br />
</DIV><br />
<BR><br />
<DIV ID="tmp" STYLE=" background-color: #dddddd; width= 100%;">&nbsp;</DIV><br />
<BR></p>
]]></content:encoded>
			<wfw:commentRss>http://vint.ca/2010/08/pronounceable-password-generator-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fixing &#8220;Warning: file_get_contents()&#8221; php error</title>
		<link>http://vint.ca/2010/08/fixing-warning-file_get_contents-php-error/</link>
		<comments>http://vint.ca/2010/08/fixing-warning-file_get_contents-php-error/#comments</comments>
		<pubDate>Mon, 09 Aug 2010 23:31:07 +0000</pubDate>
		<dc:creator>Paul Vint</dc:creator>
				<category><![CDATA[PHP Hints and Tricks]]></category>

		<guid isPermaLink="false">http://vint.ca/wordpress/?p=29</guid>
		<description><![CDATA[I recently got the following error on a newly installed webserver:
Warning:  file_get_contents() [function.file-get-contents]: URL file-access is disabled in the server configuration in /var/www/localhost/htdocs/wordpress/wp-content/plugins/statsurfer/statsurfer.php on line 3543
This happened to me after activating StatsSurfer for this blog, and that big ugly error would appear at the top of every page.
Thankfully, the fix is quite easy (strangely [...]]]></description>
			<content:encoded><![CDATA[<p>I recently got the following error on a newly installed webserver:</p>
<p><strong>Warning</strong>:  file_get_contents() [<a href="function.file-get-contents">function.file-get-contents</a>]: URL file-access is disabled in the server configuration in <strong>/var/www/localhost/htdocs/wordpress/wp-content/plugins/statsurfer/statsurfer.php</strong> on line <strong>3543</strong><br />
This happened to me after activating StatsSurfer for this blog, and that big ugly error would appear at the top of every page.</p>
<p>Thankfully, the fix is quite easy (strangely hard to google for though), in your php.ini file (mine&#8217;s at /etc/php/apache2-php5/php.ini &#8211; other *nix variants will be similar), just change the following line in the php.ini file from:</p>
<p><strong>allow_url_fopen = Off</strong></p>
<p>To:</p>
<p><strong>allow_url_fopen = On</strong></p>
<p>I recently got the following error on a newly installed webserver:</p>
<p><strong>Warning</strong>:  file_get_contents() [<a href="function.file-get-contents">function.file-get-contents</a>]:  URL file-access is disabled in the server configuration in <strong>/var/www/localhost/htdocs/wordpress/wp-content/plugins/statsurfer/statsurfer.php</strong> on line <strong>3543</strong><br />
This happened to me after activating  StatsSurfer for this blog, and that big ugly error would appear at the  top of every page.</p>
<p>Thankfully, the fix is quite easy (strangely  hard to google for though), in your php.ini file (mine&#8217;s at  /etc/php/apache2-php5/php.ini &#8211; other *nix variants will be similar),  just change the following line in the php.ini file from:</p>
<p><strong>allow_url_fopen  = Off</strong></p>
<p>To:</p>
<p><strong>allow_url_fopen  = On</strong></p>
<p>Restart Apache, and off you go.</p>
]]></content:encoded>
			<wfw:commentRss>http://vint.ca/2010/08/fixing-warning-file_get_contents-php-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Backing up MySQL database by database and table</title>
		<link>http://vint.ca/2010/08/backing-up-mysql-database-by-databse-and-table/</link>
		<comments>http://vint.ca/2010/08/backing-up-mysql-database-by-databse-and-table/#comments</comments>
		<pubDate>Mon, 02 Aug 2010 13:46:26 +0000</pubDate>
		<dc:creator>Paul Vint</dc:creator>
				<category><![CDATA[MySQL Tips]]></category>

		<guid isPermaLink="false">http://vint.ca/wordpress/?p=22</guid>
		<description><![CDATA[Backing up mysql databases using mysqldump is pretty quick and painless:
mysqldump -u username -ppassword -h hostname db_name &#62; backup_file.sql
or
mysqldump -u username -ppassword -h hostname --all-databases &#62; backup_file
The only problem is that it becomes quite cumbersome recover a particular table.
I wrote  a little script to backup each table in each database to its own file:
#!/bin/bash

if [...]]]></description>
			<content:encoded><![CDATA[<p>Backing up mysql databases using mysqldump is pretty quick and painless:<br />
<code>mysqldump -u username -ppassword -h hostname db_name &gt; backup_file.sql</code><br />
or<br />
<code>mysqldump -u username -ppassword -h hostname --all-databases &gt; backup_file</code></p>
<p>The only problem is that it becomes quite cumbersome recover a particular table.</p>
<p>I wrote  a little script to backup each table in each database to its own file:</p>
<pre name="code" class="php">#!/bin/bash

if [ $# -lt 2 ]
then
        echo "Usage: backup_all_tables username password [host]"
        exit
fi

mysql_bin="/usr/bin/mysql"
mysqldump_bin="/usr/bin/mysqldump"
backup_path="/opt/backups/www/"

if [ $# -eq 3 ]
then
        host=$3
else
        host="localhost"
fi

user=$1
pass=$2

for db in `echo "show databases" | $mysql_bin -u $user -p$pass -h $host | grep -v Database | grep -v information_schema`
do
        for table in `echo "show tables" | $mysql_bin -u $user -p$pass -h $host $db | grep -v "Tables_in"`
        do
                echo "Backing up $host.$db.$table to $backup_path${host}_$db.$table.sql"
                $mysqldump_bin -u $user -p$pass -h $host $db $table &gt; ${backup_path}${host}_$db.$table.sql
        done
done
</pre>
<p>save the script as &#8220;backup_all_tables.sh&#8221;, edit the $backup_path variable to suit, do a chmod +x backup_all_tables to make it executable, and run it using:<br />
<code>./backup_all tables username password hostname</code><br />
If the database is on your local machine you can omit the hostname.</p>
<p>This will backup the files in the format &#8220;host_db.table.sql&#8221;, ie: &#8220;localhost_mysql.user.sql&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://vint.ca/2010/08/backing-up-mysql-database-by-databse-and-table/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Huge sendmail queue &#8211; clearing it out</title>
		<link>http://vint.ca/2010/08/huge-sendmail-queue-clearing-it-out/</link>
		<comments>http://vint.ca/2010/08/huge-sendmail-queue-clearing-it-out/#comments</comments>
		<pubDate>Sun, 01 Aug 2010 20:02:35 +0000</pubDate>
		<dc:creator>Paul Vint</dc:creator>
				<category><![CDATA[Linux Reference]]></category>

		<guid isPermaLink="false">http://vint.ca/wordpress/?p=16</guid>
		<description><![CDATA[There are numerous reasons that the mail queue can get over full, ranging from general network problems, to having a user repeatedly sending an email with a large attachment to an incorrectly type address.
The first thing you likely want to do is get some information on what&#8217;s in the queue:
To find out how many messages [...]]]></description>
			<content:encoded><![CDATA[<p>There are numerous reasons that the mail queue can get over full, ranging from general network problems, to having a user repeatedly sending an email with a large attachment to an incorrectly type address.</p>
<p>The first thing you likely want to do is get some information on what&#8217;s in the queue:<br />
To find out how many messages are in the queue:<br />
<code>mailq | tail -1</code><br />
This will give you the total number of emails in the queue, ie:<br />
<code>Total requests: 6592</code><br />
You might also want to know how old or new they are, so:<br />
<code>ls -lt | tail -10</code><br />
and<br />
<code>ls -ltr | tail -10</code><br />
will show you the oldest 10 and the newest 10 respectively.<br />
To have sendmail retry the emails, simply run (as root):<br />
<code>sendmail -q -v</code><br />
If you are in a situation where it has filled up the disk and need to fix it FAST, move the directory to another partition and then have sendmail process it from there (stopping sendmail with &#8220;/etc/init.d/sendmail stop&#8221; is recommended:<br />
<code>mkdir /root/tmpq<br />
mv /var/spool/mqueue/* /root/tmpq<br />
sendmail -q -v -oQ/root/tmpq</code><br />
(if you get an error like &#8220;Argument list too long&#8221; instead run &#8220;mv /var/spool/mqueue /root/tmp&#8221; with sendmail stopped, then restart it)</p>
]]></content:encoded>
			<wfw:commentRss>http://vint.ca/2010/08/huge-sendmail-queue-clearing-it-out/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The importance of email quotas</title>
		<link>http://vint.ca/2010/07/the-importance-of-email-quotas/</link>
		<comments>http://vint.ca/2010/07/the-importance-of-email-quotas/#comments</comments>
		<pubDate>Sat, 31 Jul 2010 17:20:24 +0000</pubDate>
		<dc:creator>Paul Vint</dc:creator>
				<category><![CDATA[Linux Reference]]></category>

		<guid isPermaLink="false">http://vint.ca/wordpress/?p=13</guid>
		<description><![CDATA[Running an email server can result in some strange problems at times &#8211; a common one being the /var/spool/mqueue filling up (which I really need to write an article on&#8230;.), and one which can be hard to pin down: A POP3 user with a mailbox that is too big.
I recently ran into a scenario where [...]]]></description>
			<content:encoded><![CDATA[<p>Running an email server can result in some strange problems at times &#8211; a common one being the /var/spool/mqueue filling up (which I really need to write an article on&#8230;.), and one which can be hard to pin down: A POP3 user with a mailbox that is too big.</p>
<p>I recently ran into a scenario where a user&#8217;s mailbox (which REALLY should have had a quota, but didn&#8217;t) had grown quite large (~1GB). When the user went to check their mail, the following would happen:</p>
<ol>
<li>Mail client (Thunderbird, in this case), connects to the mail server and sends username and password</li>
<li>When the user is authenticated (right after the client sends the &#8220;PASS xxxxx&#8221; command), the pop3d process makes a copy of the user&#8217;s mailbox in the temporary directory (/tmp in my case)</li>
<li>There was insufficient space for the copy of the user&#8217;s mailbox in the temporary directory, and when if ills up the server aborts the operation sending an error like &#8220;-ERR cannot open mailbox /home/userdir/.mail/mbox: No space left on device&#8221;</li>
<li>The pop3d process clears out the temporary file (something like /tmp/pop3oj5oyy) freeing up the space</li>
<li>Email client (hopefully) shows the end user a meaningful error</li>
</ol>
<p>The real problem with this process is the momentary filling up of the temporary directory which can cause a problem for virtually any other process (in my case it was frequently showing up as database errors on websites, amongst other odd problems)</p>
<p>In this case, I found I had a user&#8217;s mailbox file that was about 1.2GB:<br />
<code>ls -sh /home/userdir/.mail/mbox<br />
1.2G mbox</code></p>
<p>To check how many messages there are in it run:<br />
<code>grep -c "^From\ " mbox<br />
15881</code></p>
<p>15000+ messages!</p>
<p>Now to the fixing it part:</p>
<p>First move to another location so that nothing is added to it while working with it (preferably after shutting down your MTA, ie: /etc/init.d/sendmail stop &#8211; depending on your situation, this may not be practical) and switch to the directory where it is:<br />
<code>mv /home/userdir/.mail/mbox ~/mbox.tmp &#038;&#038; cd ~</code><br />
In my case, I figure if I break it into 10 chunks (about 1500 messages each) it should work fine:</p>
<p><code>cat mbox.tmp | formail -1500 -s > mbox.1</code></p>
<p>This gave me a file about 115MB.<br />
If you shut down your MTA, just copy/move that file to the location where the original mailbox file was, fire up the MTA, and download the mail. If you did not shut down the MTA, you should append this new file to the mailbox that may be there now (if there was any new mail received). Note: This may be slightly dangerous, so making a backup copy of the mailbox file that is in place is highly recommended):</p>
<p><code>cat mbox.1 >> /home/userdir/.mail/mbox</code><br />
Then, as above, download the mail.</p>
<p>Second chunk:<br />
<code>cat mbox.tmp | formail +1500 -1500 -s >mbox.2</code><br />
Move the mbox.2 file as per above, and download.</p>
<p>Rinse and repeat, if necessary:<br />
<code>cat mbox.tmp | formail +3000 -1500  -s >mbox.2</code><br />
Increasing the &#8220;+xxx value by the amount per download as required until it&#8217;s done.</p>
<p>Oh, and back to the title of this article: If we had a quota in place on this account, none of this would ever had happened!</p>
<div class='wp_likes' id='wp_likes_post-13'><a class='like' href="javascript:wp_likes.like(13);" title='' ><img src="http://vint.ca/wordpress/wp-content/plugins/wp-likes/images/like.png" alt='' border='0'/>Like</a><span class='text'></span>
<div class='unlike'><a href="javascript:wp_likes.unlike(13);">Unlike</a></div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://vint.ca/2010/07/the-importance-of-email-quotas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
