<?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>Things to Remember</title>
	<atom:link href="http://blog.tusoffka.org/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.tusoffka.org</link>
	<description></description>
	<lastBuildDate>Wed, 26 May 2010 14:48:10 +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>Why the MTU Size Must Be Changed</title>
		<link>http://blog.tusoffka.org/2010/05/26/why-the-mtu-size-must-be-changed/</link>
		<comments>http://blog.tusoffka.org/2010/05/26/why-the-mtu-size-must-be-changed/#comments</comments>
		<pubDate>Wed, 26 May 2010 14:45:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Cisco, Networking]]></category>

		<guid isPermaLink="false">http://blog.tusoffka.org/?p=155</guid>
		<description><![CDATA[When a user requests a web site, a client/server negotiation occurs between the PC and the web server that hosts the web site. During the negotiation, a maximum MTU size is negotiated. Since the PC negotiates and its default MTU size is 1500 bytes (Windows 3x, 9x, NT, ME, and so forth), the web server [...]]]></description>
			<content:encoded><![CDATA[<p>When a user requests a web site, a client/server negotiation occurs between the PC and the web server that hosts the web site. During the negotiation, a maximum MTU size is negotiated. Since the PC negotiates and its default MTU size is 1500 bytes (Windows 3x, 9x, NT, ME, and so forth), the web server negotiates an MTU size of 1500 bytes. Therefore, regardless of the MTU size you configure on the router, the web server still sends packets up to 1500 bytes in size.</p>
<p>The reason why some pages do not fully load is that the router fragments IP packets if the PC MTU is misconfigured and a packet greater than 1492 bytes is sent to the router. This fragmentation does not occur on the return path through the universal access concentrator (UAC) (Cisco 6400 or 7200). When the UAC receives a packet greater than 1492 bytes, the packet is dropped, and the UAC generates and sends an Internet Control Message Protocol (ICMP) message to the web server that sent the oversized packet. The ICMP informs the web server that it sent an oversized packet and that it needs to resend the packet with a smaller MTU.</p>
<p><strong>Note:</strong> For information about why the MTU size is 1492 bytes, refer to the <a href="http://www.cisco.com/en/US/tech/tk175/tk15/technologies_white_paper09186a0080093e55.shtml" target="_blank">PPPoE Baseline Architecture for the Cisco 6400</a> white paper.</p>
<p>The problem occurs because many web servers block ICMP messages, which causes the server to continuously send 1500-byte packets. These packets are dropped, and as a result, the requested web site does not load. If the web server is properly configured and ICMP messages are not blocked, the server adjusts its MTU and retransmits until the page loads completely.</p>
<p>A partially loaded page occurs when the initial data packets sent from the web server are under the 1492 byte maximum. However, a packet is then sent that exceeds this maximum. The server continues to retransmit this oversized packet that results in a partially loaded page and a &#8220;waiting for reply&#8230;&#8221; message in the status bar.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tusoffka.org/2010/05/26/why-the-mtu-size-must-be-changed/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Everything Burns(Ben Moody ft. Anastacia)</title>
		<link>http://blog.tusoffka.org/2009/10/13/everything-burns-ben-moody-ft-anastacia-lyrics-and-accords/</link>
		<comments>http://blog.tusoffka.org/2009/10/13/everything-burns-ben-moody-ft-anastacia-lyrics-and-accords/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 01:20:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Lyrics/Accords/Tabs]]></category>

		<guid isPermaLink="false">http://blog.tusoffka.org/?p=135</guid>
		<description><![CDATA[She sits in her corner, Singing herself to sleep
Wrapped in all of the promises,  That no one seems to keep
She no longer cries to herself,  No tears left to wash away
Just diaries of empty pages,  Feelings gone astray
But she will sing]]></description>
			<content:encoded><![CDATA[<p>[ANASTACIA]</p>
<p><strong>Bm                        A            F#m                        G</strong><br />
She sits in her corner, Singing herself to sleep<br />
<strong> Bm                                   A</strong><strong> F#m                                             G</strong><br />
Wrapped in all of the promises,  That no one seems to keep<br />
<strong> Bm                                                    A</strong><strong> F#m                                                 G</strong><br />
She no longer cries to herself,  No tears left to wash away<br />
<strong> Bm                                                  A </strong><strong>F#m                              G</strong><br />
Just diaries of empty pages,  Feelings gone astray<br />
<strong> G                      A</strong><br />
But she will sing<span id="more-135"></span></p>
<p>[CHORUS: Ben Moody / Anastacia]<br />
<strong>Bm</strong> <strong>G</strong><br />
&#8216;Till everything burns, While everyone screams<br />
<strong>Em </strong><strong>A</strong><br />
Burning their lies,  Burning my dreams<br />
<strong>Bm </strong><strong>G</strong><br />
All of this hate, And all of this pain<br />
<strong>Em</strong> <strong>A</strong><br />
I&#8217;ll burn it all down, As my anger reigns<br />
&#8216;Till everything burns</p>
<p>[ANASTACIA]<br />
Ooh, oh</p>
<p>[BEN MOODY]</p>
<p><strong>Bm                       A </strong><strong>F#m                      G</strong><br />
Walking through life unnoticed,  Knowing that no one cares<br />
<strong>Bm                           A </strong><strong>F#m                G</strong><br />
Too consumed in their masquerade,  No one sees her there<br />
<strong>G               A</strong><br />
And still she sings</p>
<p>[CHORUS: Ben Moody / Anastacia]<br />
<strong>Bm </strong><strong>G</strong><br />
&#8216;Till everything burns,  While everyone screams<br />
<strong>Em </strong><strong>A</strong><br />
Burning their lies,  Burning my dreams<br />
<strong>Bm </strong><strong>G</strong><br />
All of this hate,  And all of this pain<br />
<strong>Em </strong><strong>A</strong><br />
Burn it all down,  As my anger reigns</p>
<p>[BEN MOODY / ANASTACIA]<br />
&#8216;Till everything burns<br />
Everything burns<br />
(Everything burns)<br />
Everything burns<br />
Watching it all fade away<br />
(All fade away)<br />
Everyone screams<br />
Everyone screams..<br />
(Watching it all fade away)<br />
Oooh, ooh..<br />
(While everyone screams)<br />
Burning their lies<br />
Burning my dreams<br />
(All of this hate)<br />
And all of this pain<br />
I&#8217;ll burn it all down<br />
As my anger reigns<br />
Til everything burns<br />
(Everything burns)<br />
Watching it all fade away<br />
(Oooh, ooh)<br />
(Everything burns)<br />
Watching it all fade away&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tusoffka.org/2009/10/13/everything-burns-ben-moody-ft-anastacia-lyrics-and-accords/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Proper way to increase innodb_log_file_size</title>
		<link>http://blog.tusoffka.org/2009/08/12/increase-innodb_log_file_size-the-proper-way/</link>
		<comments>http://blog.tusoffka.org/2009/08/12/increase-innodb_log_file_size-the-proper-way/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 19:09:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Databases]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://blog.tusoffka.org/?p=127</guid>
		<description><![CDATA[If you modify the innodb_log_file_size, MySQL will fail to restart and InnoDB will complain about the size of the changed log file.
The proper way to increase the innodb_log_file_size:
1. shutdown mysql server
2. make backup of data and log files
3. remove InnoDB log files
4. set new value for innodb_log_file_size in my.cnf
5. start mysqld
6. check error logs to [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-thumbnail wp-image-128" title="logo-mysql" src="http://blog.tusoffka.org/wp-content/uploads/2009/08/logo-mysql-150x109.jpg" alt="logo-mysql" width="150" height="109" />If you modify the innodb_log_file_size, MySQL will fail to restart and InnoDB will complain about the size of the changed log file.</p>
<p>The proper way to increase the innodb_log_file_size:<span id="more-127"></span></p>
<p style="padding-left: 30px;">1. shutdown mysql server<br />
2. make backup of data and log files<br />
3. remove InnoDB log files<br />
4. set new value for innodb_log_file_size in my.cnf<br />
5. start mysqld<br />
6. check error logs to ensure everything went fine.</p>
<p>Also see:</p>
<p style="padding-left: 30px;"><a href="http://www.mysqlperformanceblog.com/2006/07/03/choosing-proper-innodb_log_file_size/" target="_blank">Choosing proper innodb_log_file_size</a></p>
<p style="text-align: right;">from <a href="http://mysqldatabaseadministration.blogspot.com/2007/01/increase-innodblogfilesize-proper-way.html" target="_blank">MySQL DBA blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tusoffka.org/2009/08/12/increase-innodb_log_file_size-the-proper-way/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How much interest do you pay on different APRs per month</title>
		<link>http://blog.tusoffka.org/2009/08/11/how-much-interest-do-you-pay-on-different-aprs-per-month/</link>
		<comments>http://blog.tusoffka.org/2009/08/11/how-much-interest-do-you-pay-on-different-aprs-per-month/#comments</comments>
		<pubDate>Tue, 11 Aug 2009 18:47:55 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[APRs per month]]></category>
		<category><![CDATA[finance]]></category>

		<guid isPermaLink="false">http://blog.tusoffka.org/?p=114</guid>
		<description><![CDATA[While monthly interest costs is a simple calculation it is nice to know what your debt is costing each month. What if I paid an extra $1,000 on my credit card? How much would that increase my net monthly income?
While $10 a month doesn’t sound like much savings it all adds up quick. If you [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-thumbnail wp-image-116" title="MoneyCoins" src="http://blog.tusoffka.org/wp-content/uploads/2009/08/MoneyCoins-150x149.jpg" alt="MoneyCoins" width="150" height="149" />While monthly interest costs is a simple calculation it is nice to know what your debt is costing each month. What if I paid an extra $1,000 on my credit card? How much would that increase my net monthly income?</p>
<p>While $10 a month doesn’t sound like much savings it all adds up quick. If you have $10,000 in credit card debt you’d be paying $100 a month just in interest fees. Fighting to get back $10 a month in residual income is well worth it.<span id="more-114"></span></p>
<p><strong>Cost of $1,000 debt every month:</strong></p>
<p>5% APR costs $4.17 per month<br />
6% APR costs $5.00 per month<br />
7% APR costs $5.83 per month<br />
8% APR costs $6.67 per month<br />
9% APR costs $7.50 per month<br />
10% APR costs $8.33 per month<br />
11% APR costs $9.17 per month<br />
12% APR costs $10.00 per month<br />
13% APR costs $10.83 per month<br />
14% APR costs $11.67 per month<br />
15% APR costs $12.50 per month<br />
16% APR costs $13.33 per month<br />
17% APR costs $14.17 per month<br />
18% APR costs $15.00 per month<br />
19% APR costs $15.83 per month<br />
20% APR costs $16.67 per month<br />
21% APR costs $17.50 per month<br />
22% APR costs $18.33 per month</p>
<p style="text-align: right;">from <a href="http://moneytipcentral.com/how-much-interest-do-you-pay-on-different-aprs-per-month" target="_blank">http://moneytipcentral.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tusoffka.org/2009/08/11/how-much-interest-do-you-pay-on-different-aprs-per-month/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Postfix system generated emails &#8220;loops back to myself&#8221; error</title>
		<link>http://blog.tusoffka.org/2009/08/06/postfix-mail-for-domain-com-loops-back-to-myself/</link>
		<comments>http://blog.tusoffka.org/2009/08/06/postfix-mail-for-domain-com-loops-back-to-myself/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 20:03:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Misc]]></category>
		<category><![CDATA[mail loops back to myself]]></category>
		<category><![CDATA[Postfix]]></category>

		<guid isPermaLink="false">http://blog.tusoffka.org/?p=106</guid>
		<description><![CDATA[I can send and receive mail using user@example.com, but system generated emails such as root@mail.example.com bounce backup with an error:
May 1 03:14:52 mail postfix/smtp[62798]: 23CA4BD6B40: to=, relay=none, delay=0.01, delays=0/0/0/0, dsn=5.4.6, status=bounced (mail for mail.example.com loops back to myself)
How do I fix this error?
Postfix did found a dns reply to your email server, but it hasn&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-21" title="logo_postfix" src="http://blog.tusoffka.org/wp-content/uploads/2009/07/logo_postfix.jpg" alt="logo_postfix" width="149" height="116" />I can send and receive mail using user@example.com, but system generated emails such as root@mail.example.com bounce backup with an error:</p>
<p style="padding-left: 180px;">May 1 03:14:52 mail postfix/smtp[62798]: 23CA4BD6B40: to=, relay=none, delay=0.01, delays=0/0/0/0, dsn=5.4.6, status=bounced (mail for mail.example.com loops back to myself)<span id="more-106"></span></p>
<p>How do I fix this error?</p>
<p>Postfix did found a dns reply to your email server, but it hasn&#8217;t been configured to deal with address such as root@mail.example.com. In other words, your server is configured to accept user@example.com but not as user@mail.example.com. This is well known config problem with virtual domain. To fix this error either add system FQDN to mydestination or relay_domains. Postfix accepts mail for domain listed in virtual_mailbox_domains, virtual_alias_domains, and domains that resolve to IP addresses listed in inet_interfaces and proxy_interfaces. Update mydestination using postconf or by editing main.cf file:</p>
<pre style="padding-left: 30px;">mydestination = localhost.$mydomain, localhost, mail.example.com</pre>
<p>Once done reload postfix:</p>
<pre style="padding-left: 30px;"># /usr/local/etc/rc.d/postfix reload</pre>
<p style="text-align: right;">thanks to <a href="http://www.cyberciti.biz/faq/postfix-mail-for-domaincom-loops-back-to-myself-error-and-solution/" target="_blank">http://www.cyberciti.biz</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tusoffka.org/2009/08/06/postfix-mail-for-domain-com-loops-back-to-myself/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Nokia E71 &#8211; Useful Tips &amp; Tricks</title>
		<link>http://blog.tusoffka.org/2009/08/03/the-nokia-e71-useful-tips-tricks/</link>
		<comments>http://blog.tusoffka.org/2009/08/03/the-nokia-e71-useful-tips-tricks/#comments</comments>
		<pubDate>Mon, 03 Aug 2009 20:24:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Misc]]></category>
		<category><![CDATA[E71]]></category>
		<category><![CDATA[Nokia]]></category>
		<category><![CDATA[smartphone]]></category>

		<guid isPermaLink="false">http://blog.tusoffka.org/?p=85</guid>
		<description><![CDATA[The E71 was one of the very best handsets to come out of Nokia factories in 2008 and the best ever in my book. So it is only right that we utilize its functionality to the absolute hilt and try and make the E71 even more efficient.
Here is a long list of must know tips [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-thumbnail wp-image-95" title="nokia-e71" src="http://blog.tusoffka.org/wp-content/uploads/2009/08/nokia-e71-124x150.jpg" alt="nokia-e71" width="124" height="150" />The E71 was one of the very best handsets to come out of Nokia factories in 2008 and the best ever in my book. So it is only right that we utilize its functionality to the absolute hilt and try and make the E71 even more efficient.</p>
<p>Here is a long list of must know tips and tricks for the E71. You might already know a few but if you are new to S60 and the E71 in particular, I’m sure this will make for a happy start to the E71 new year!<span id="more-85"></span></p>
<ul>
<li><strong>STICKY FUNCTION KEY</strong> – A quick double press on the bottom left ‘function’ key locks it. This is helpful in situations when you need to press a combination of keys or in applications like Gmail which can be controlled via the keypad.</li>
</ul>
<ul>
<li><strong> 1-800-WHATEVER</strong> &#8211; To dial 1-800-WHATEVER: type 1800, hit Fn, then Shift twice, type WHATEVER, and press the Call/Green key to dial. (The idea is to type in the alphabet mode in CAPITAL letters ONLY). The alphabets will automatically be converted to numbers.</li>
</ul>
<ul>
<li><strong> ONE TOUCH MUTE</strong> – You can simply mute a call by press the button between the volume keys present on the right hand side of the phone. Press it again to cancel the mute.</li>
</ul>
<ul>
<li> <strong>REMAP THE KEYS</strong> &#8211; There are times when you feel certain keys on the E71 are being wasted when they could have come in very handy. For example, the volume keys would work wonderfully with the web browser to scroll pages or in your music player and the mute key could work as select. Make that happen.</li>
</ul>
<ul>
<li><strong> TIME &amp; DATE</strong> – When the phone is in the locked state and the screen is blank, hit the Navi Button to display the time and date in a large font.</li>
</ul>
<ul>
<li><strong> TEXT MESSAGES</strong> – When in the standby mode, hold down left soft key to read out new text messages.</li>
</ul>
<ul>
<li><strong> ASSIGN SHORTCUTS</strong> -  If you have a lot of applications installed on your E71, you might want to assign additional shortcuts to different applications by definying a set of keypresses with an application called Cute Keys. Learn how here.</li>
</ul>
<p>As a follow up to the above tips, here are a few shortcuts that you should enjoy. I have highlighted some of the lesser known ones.</p>
<p><strong>GENERAL</strong></p>
<ul>
<li> To get to a symbol or number hold down its key.</li>
</ul>
<ul>
<li> Shift + Backspace deletes letters after the cursor, thus immitating the behavior of the ‘Delete’ key on the computer.</li>
</ul>
<ul>
<li> In the Main Menu:</li>
</ul>
<pre style="padding-left: 30px;">A B C D
E F G H
I J K L</pre>
<p style="padding-left: 30px;">To open A press 1, 2 for B, 3 for C, * for D, 4 for E, 5 for F and so on.</p>
<ul>
<li>Fn + Ctrl + C to copy.</li>
</ul>
<ul>
<li> Fn + Ctrl + V to paste.</li>
</ul>
<ul>
<li> Shift + Left ( or Right ) to select text.</li>
</ul>
<ul>
<li> Ctrl + Up for page up.</li>
</ul>
<ul>
<li> Ctrl + Down for page down.</li>
</ul>
<ul>
<li> Ctrl + Vowels ( or n ) for accented characters like á or ñ.</li>
</ul>
<p><strong>CAMERA</strong></p>
<ul>
<li> T to focus.</li>
</ul>
<p><strong>GALLERY</strong></p>
<ul>
<li> Green Call to send the image.</li>
</ul>
<ul>
<li> Fn + * for full screen.</li>
</ul>
<ul>
<li> Fn + 7 to zoom in. Press twice for the full screen size.</li>
</ul>
<ul>
<li> Fn + 4 to scroll left while in the zoomed image.</li>
</ul>
<ul>
<li> Fn + 5 to zoom in.</li>
</ul>
<ul>
<li> Fn + 3 to rotate right.</li>
</ul>
<ul>
<li> Fn + 2 to scroll up while in the zoomed image.</li>
</ul>
<ul>
<li> Fn + 1 to rotate left.</li>
</ul>
<ul>
<li> Fn + 0 to zoom out.</li>
</ul>
<p><strong>STANDBY</strong></p>
<ul>
<li> Hold * to activate/deactivate Bluetooth.</li>
</ul>
<ul>
<li> Hold 0 to go to the web browser.</li>
</ul>
<ul>
<li> Left Soft Key then Fn ( or * ) locks the keypad.</li>
</ul>
<ul>
<li> Hold End/Red to disconnect all data connections.</li>
</ul>
<ul>
<li> Hold Left Soft Key to read out new text messages.</li>
</ul>
<p><strong>MAIL</strong></p>
<ul>
<li> Shift + Return to mark/unmark a single message.</li>
</ul>
<ul>
<li> Shift + Down to mark multiple items.</li>
</ul>
<ul>
<li> Fn + Spacebar in new message body to access input (predictive text, etc.) options.</li>
</ul>
<p><strong>MAPS</strong></p>
<ul>
<li> Shift to zoom in.</li>
</ul>
<ul>
<li> Backspace to zoom out.</li>
</ul>
<ul>
<li> Space to go to the current position.</li>
</ul>
<p><strong>REAL PLAYER</strong></p>
<ul>
<li> Fn + 2 for full screen.</li>
</ul>
<ul>
<li> Hold Up for fast forward.</li>
</ul>
<ul>
<li> Hold Down for rewind.</li>
</ul>
<p><strong>WEB</strong></p>
<ul>
<li> 1 for bookmarks.</li>
</ul>
<ul>
<li> 2 to find something on a page.</li>
</ul>
<ul>
<li> 3 to return to the previous page.</li>
</ul>
<ul>
<li> 5 to tab open windows.</li>
</ul>
<ul>
<li> * to zoom in.</li>
</ul>
<ul>
<li> # to zoom out.</li>
</ul>
<ul>
<li> 8 for page overview.</li>
</ul>
<ul>
<li> 9 to go to a different web page.</li>
</ul>
<ul>
<li> 0 to got to the homepage.</li>
</ul>
<ul>
<li> Hit the Backspace key to close the current window.</li>
</ul>
<p style="text-align: right;">from <a href="http://thesymbianblog.com/2009/01/02/must-know-tips-tricks-for-the-e71/" target="_blank">http://thesymbianblog.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tusoffka.org/2009/08/03/the-nokia-e71-useful-tips-tricks/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>FreeBSD-Postfix-MySQL-SpamAssassin-Maia-Virtual Setup</title>
		<link>http://blog.tusoffka.org/2009/07/31/freebsd-postfix-mysql-spamassassin-maia-virtual-setup/</link>
		<comments>http://blog.tusoffka.org/2009/07/31/freebsd-postfix-mysql-spamassassin-maia-virtual-setup/#comments</comments>
		<pubDate>Fri, 31 Jul 2009 17:04:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Misc]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[Postfix MTA]]></category>
		<category><![CDATA[Virual Users]]></category>

		<guid isPermaLink="false">http://blog.tusoffka.org/?p=20</guid>
		<description><![CDATA[First, I would like to thank DrkShdw, Worth, and Fr0zen from ##FreeBSD on FreeNode for their time and ideas when it came down to me writing this tutorial/guide. So, thanks a ton, fellas! Now, on with it!
I wrote this tutorial because of the many, MANY times I’ve been asked about how to set up Postfix [...]]]></description>
			<content:encoded><![CDATA[<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">First, I would like to thank DrkShdw, Worth, and Fr0zen from ##FreeBSD on FreeNode for their time and ideas when it came down to me writing this tutorial/guide. So, thanks a ton, fellas! Now, on with it!</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">I wrote this tutorial because of the many, MANY times I’ve been asked about how to set up Postfix on a FreeBSD system. There are many great tutorials out there that can guide people through a Postfix setup. However, none of them are related to FreeBSD. So, I’ve decided to give it a go and here it is.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Note: Please be aware that there will be a lot more installed than actually concentrated on due to this tutorial utilizing the FreeBSD Ports System and installing any dependencies that a port may require to run efficiently.</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">Any questions or comments can be sent to the PHO Postfix Mailing Lists. Standard comments are welcome here on the site. However, there will be no replies via the comment pages. Also, it just seems more useful for others to be able to read questions and answers on the mailing lists. You can also join us for whatever reason you see fit on our PHO IRC Server. So, enjoy and please, please, PLEASE let me know if you run into any problems. How the hell am I to fix something if no one reports errors?</div>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px;">With the above being stated and you having still read to here, I’ll go ahead and assume that you’re going to follow this tutorial/guide. If so, please keep in mind that anything writen in BOLD, RED TEXT will be something that needs to be edited. Also, you should be sure that your FreeBSD Ports Tree is up-to-date. So, let’s get started, shall we? Use the links below to begin.</div>
<p><img class="alignleft size-full wp-image-21" title="logo_postfix" src="http://blog.tusoffka.org/wp-content/uploads/2009/07/logo_postfix.jpg" alt="logo_postfix" width="149" height="116" />First, I would like to thank DrkShdw, Worth, and Fr0zen from <a href="irc://irc.freenode.net/##FreeBSD" target="_blank">##FreeBSD</a> on <a href="http://www.freenode.net/" target="_blank">FreeNode</a> for their time and ideas when it came down to me writing this tutorial/guide. So, thanks a ton, fellas! Now, on with it!</p>
<p>I wrote this tutorial because of the many, MANY times I’ve been asked about how to set up <a href="http://www.postfix.org/" target="_blank">Postfix</a> on a <a href="http://www.freebsd.org/" target="_blank">FreeBSD</a> system. There are many great tutorials out there that can guide people through a Postfix setup. However, none of them are related to FreeBSD. So, I’ve decided to give it a go and here it is.<span id="more-20"></span></p>
<p>Note: Please be aware that there will be a lot more installed than actually concentrated on due to this tutorial utilizing the <a href="http://www.freebsd.org/ports" target="_blank">FreeBSD Ports System</a> and installing any dependencies that a port may require to run efficiently.</p>
<p>Any questions or comments can be sent to the <a href="http://lists.purplehat.org/mailman/listinfo/pho-postfix" target="_blank">PHO Postfix Mailing Lists</a>. Standard comments are welcome here on the site. However, there will be no replies via the comment pages. Also, it just seems more useful for others to be able to read questions and answers on the mailing lists. You can also join us for whatever reason you see fit on our <a href="irc://irc.purplehat.org/#Postfix" target="_blank">PHO IRC Server</a>. So, enjoy and please, please, PLEASE let me know if you run into any problems. How the hell am I to fix something if no one reports errors?</p>
<p>With the above being stated and you having still read to here, I’ll go ahead and assume that you’re going to follow this tutorial/guide. If so, please keep in mind that anything writen in <strong><span style="color: #ff0000;">BOLD, RED TEXT</span></strong> will be something that needs to be edited. Also, you should be sure that your FreeBSD Ports Tree is up-to-date. So, let’s get started, shall we? Use the links below to begin.</p>
<p><strong>Base MTA Setup:</strong></p>
<p style="padding-left: 30px;"><a href="#1 - MySQL Install">1 &#8211; MySQL Install</a><br />
<a href="#2 - Dovecot Install">2 &#8211; Dovecot Install</a><br />
<a href="#3 - Postfix Install">3 &#8211; Postfix Install</a><br />
<a href="#4 - Apache Install">4 &#8211; Apache Install</a><br />
<a href="#5 - PHP Install">5 &#8211; PHP Install</a><br />
<a href="#6 - Postfixadmin Install">6 &#8211; Postfixadmin Install</a><br />
<a href="#8 - SpamAssassin Install">8 &#8211; SpamAssassin Install</a><br />
<a href="#9 - FuzzyOCR Install">9 &#8211; FuzzyOCR Install</a><br />
<a href="#10 - Clam Anti-Virus Install">10 &#8211; Clam Anti-Virus Install</a><br />
<a href="#11 - PEAR Install">11 &#8211; PEAR Install</a><br />
<a href="#12 - Maia-Mailguard Install">12 &#8211; Maia-Mailguard Install</a></p>
<p><strong>Optional Applications:</strong></p>
<p style="padding-left: 30px;"><a href="#13 - SquirrelMail Install">13 &#8211; SquirrelMail Install</a><br />
<a href="#14 - Mailman Install">14 &#8211; Mailman Install</a><br />
<a href="#15 - Mailgraph Install">15 &#8211; Mailgraph Install</a><br />
<a href="#16 - Roundcube Install">16 &#8211; Roundcube Install</a></p>
<p><a name="1 - MySQL Install"></a><strong>1 &#8211; MySQL Install</strong></p>
<p style="padding-left: 30px;">MySQL is a database application that is very fast and very reliable. You can read more about it by visiting <a href="http://www.mysql.com" target="_blank">http://www.mysql.com</a>.</p>
<p style="padding-left: 30px;">This tutorial installs version <strong>5.0.51a</strong>.</p>
<p style="padding-left: 30px;"><strong><em>Install MySQL via ports:</em></strong></p>
<pre style="padding-left: 60px;">#cd /usr/ports/databases/mysql50-server
#make all install clean</pre>
<p style="padding-left: 30px;"><strong><em>Add mysqld to system startup:</em></strong></p>
<pre style="padding-left: 60px;">#echo 'mysql_enable="YES"' &gt;&gt; /etc/rc.conf</pre>
<p style="padding-left: 30px;"><strong><em>Start MySQL:</em></strong></p>
<pre style="padding-left: 60px;">#/usr/local/etc/rc.d/mysql-server start</pre>
<p style="padding-left: 30px;"><strong><em>Secure MySQL root user account and delete nameless user(s):</em></strong></p>
<pre style="padding-left: 60px;">#mysql -u root mysql
&gt;UPDATE user SET Password=PASSWORD('<span style="color: #ff0000;">mysql_root_password</span>') WHERE User='root';
&gt;DELETE FROM user WHERE User='';
&gt;FLUSH PRIVILEGES;
&gt;quit;</pre>
<p style="padding-left: 30px;"><strong><em>Copy my.cnf for MySQL:</em></strong></p>
<pre style="padding-left: 60px;">#cp /usr/local/share/mysql/my-medium.cnf /var/db/mysql/my.cnf</pre>
<p style="padding-left: 30px;"><strong><em>Edit /var/db/mysql/my.cnf file:</em></strong><br />
This is to allow MySQL to process files up to 10 Megabytes in size and also keep the INNODB files from getting too large. Find and edit the <span style="color: #ff0000;">RED TEXT</span>.</p>
<pre style="padding-left: 60px;">...
[mysqld]
port            = 3306
socket          = /tmp/mysql.sock
skip-locking
key_buffer = 16M
max_allowed_packet = <span style="color: #ff0000;">10M</span>
table_cache = 64
sort_buffer_size = 512K
...
# Uncomment the following if you are using InnoDB tables
<span style="color: #ff0000;">innodb_data_home_dir = /var/db/mysql/
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = /var/db/mysql/
innodb_log_arch_dir = /var/db/mysql/</span>
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
<span style="color: #ff0000;">innodb_buffer_pool_size = 16M
innodb_additional_mem_pool_size = 2M</span>
# Set .._log_file_size to 25 % of buffer pool size
<span style="color: #ff0000;">innodb_log_file_size = 5M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50
...</span></pre>
<p style="padding-left: 30px;"><strong><em>Restart MySQL for new changes:</em></strong></p>
<pre style="padding-left: 60px;">#/usr/local/etc/rc.d/mysql-server restart</pre>
<p><strong>2 &#8211; Dovecot Install</strong></p>
<p style="padding-left: 30px;">Dovecot is a very fast, very reliable, and easily configured POP3/IMAP server application. You can read more about it by visiting their website at <a href="http://www.dovecot.org/" target="_blank">http://www.dovecot.org</a>.</p>
<p style="padding-left: 30px;">This tutorial installs version <strong>1.1.2_1</strong>.</p>
<p style="padding-left: 30px;"><strong><em>Install Dovecot via ports:</em></strong></p>
<pre style="padding-left: 60px;">#cd /usr/ports/mail/dovecot
#make all install clean
(Be sure "<span style="color: #ff0000;">SSL</span>", "<span style="color: #ff0000;">IPV6</span>", "<span style="color: #ff0000;">POP3</span>", and "<span style="color: #ff0000;">MYSQL</span>" are selected in the menu)</pre>
<p style="padding-left: 30px;"><strong><em>Edit /etc/rc.conf so Dovecot starts at boot:</em></strong></p>
<pre style="padding-left: 60px;">#echo 'dovecot_enable="YES"' &gt;&gt; /etc/rc.conf</pre>
<p style="padding-left: 30px;"><strong><em>Copy Dovecot configuration files:</em></strong></p>
<pre style="padding-left: 60px;">#cp /usr/local/share/examples/dovecot/dovecot.conf /usr/local/etc/dovecot.conf
#cp /usr/local/share/examples/dovecot/dovecot-sql.conf /usr/local/etc/dovecot-sql.conf</pre>
<p style="padding-left: 30px;"><em><strong>Create SSL/TLS certificate for secure connections:</strong></em></p>
<pre style="padding-left: 60px;">#mkdir -p /etc/ssl/dovecot
#cd /etc/ssl/dovecot
#openssl req -new -x509 -nodes -out cert.pem -keyout key.pem -days 365</pre>
<p style="padding-left: 30px;"><strong><em>Edit /usr/local/etc/dovecot.conf file:</em></strong><br />
Find and edit the <span style="color: #ff0000;">red text</span>.</p>
<pre style="padding-left: 60px;">protocols = <span style="color: #ff0000;">imap imaps pop3 pop3s</span>
disable_plaintext_auth = <span style="color: #ff0000;">no</span>
ssl_disable = <span style="color: #ff0000;">no</span>
ssl_cert_file = <span style="color: #ff0000;">/etc/ssl/dovecot/cert.pem</span>
ssl_key_file = <span style="color: #ff0000;">/etc/ssl/dovecot/key.pem</span>
login_greeting = I<span style="color: #ff0000;">SP Mail Server Ready.</span>
mail_location = <span style="color: #ff0000;">maildir:/usr/local/virtual/%d/%n</span>
first_valid_uid = <span style="color: #ff0000;">125</span>
last_valid_uid = <span style="color: #ff0000;">125</span>
first_valid_gid = <span style="color: #ff0000;">125</span>
last_valid_gid = <span style="color: #ff0000;">125</span>
protocol imap {
   mail_plugins = <span style="color: #ff0000;">quota imap_quota</span>
}
protocol pop3 {
   mail_plugins = <span style="color: #ff0000;">quota</span>
}
protocol lda {
   postmaster_address = <span style="color: #ff0000;">postmaster@domain.tld</span>
}
auth default {
   mechanisms = <span style="color: #ff0000;">plain login</span>
<span style="color: #ff0000;">   #</span> passdb pam {
<span style="color: #ff0000;">   #</span> }
   passdb sql {
      args = <span style="color: #ff0000;">/usr/local/etc/dovecot-sql.conf</span>
   }
<span style="color: #ff0000;">   #</span> userdb passwd {
<span style="color: #ff0000;">   #</span> }
   userdb sql {
      args = <span style="color: #ff0000;">/usr/local/etc/dovecot-sql.conf</span>
   }
   socket listen {
      client {
         path = <span style="color: #ff0000;">/var/spool/postfix/private/auth</span>
         mode = <span style="color: #ff0000;">0660</span>
         user = <span style="color: #ff0000;">postfix</span>
         group = <span style="color: #ff0000;">postfix</span>
      }
   }
}</pre>
<p style="padding-left: 30px;"><strong><em>NOTE:</em></strong></p>
<p style="padding-left: 60px;">There is a temporary issue with the latest release of Dovecot’s configuration file that leaves the “<span style="color: #ff0000;">auth_username_format = %Lu</span>” line uncommented. If this line is indeed uncommented, be sure you comment it out to avoid Dovecot deprecating the “@domain.tld” part of your username for authentication. This WILL be fixed in the next port update (hopefully) so this should only be a temporary issue…</p>
<p style="padding-left: 30px;"><strong><em>Edit /usr/local/etc/dovecot-sql.conf file:</em></strong><br />
You can either copy this file or edit your own file to match.</p>
<pre style="padding-left: 60px;">driver = <span style="color: #ff0000;">mysql</span>
connect = host=l<span style="color: #ff0000;">ocalhost</span> dbname=<span style="color: #ff0000;">postfix</span> user=<span style="color: #ff0000;">postfix</span> password=<span style="color: #ff0000;">postfix_mysql_password</span>
default_pass_scheme = <span style="color: #ff0000;">MD5</span>
password_query = <span style="color: #ff0000;">SELECT password FROM mailbox WHERE username = '%u'</span>
user_query = <span style="color: #ff0000;">SELECT maildir, 125 AS uid, 125 AS gid, CONCAT('maildir:storage=', FLOOR( quota / 1024 ) ) AS quota FROM mailbox WHERE username = '%u' AND active = '1'</span></pre>
<p style="padding-left: 30px;"><strong><em>IMPORTANT NOTE:</em></strong></p>
<p style="padding-left: 60px;">Be sure that ALL the previous changes remain on a sinlge line. Also, the user_query line contains a bit in the query to allow Dovecot to return quota usage. If you don’t want or don’t need quota usage returned, you can just remove that bit from the query…</p>
<p><strong>3 &#8211; Postfix Install</strong></p>
<p style="padding-left: 30px;">Postfix is by far an MTA favorite amongst anyone who has every been a mail server administrator. It’s ease of use and stability is second to none. You can read more about it by visiting their website at <a href="http://www.postfix.org" target="_blank">http://www.postfix.org</a>.</p>
<p style="padding-left: 30px;">This tutorial installs version <strong>2.5.1_2,1.</strong></p>
<p style="padding-left: 30px;"><strong><em>Install Postfix via ports:</em></strong></p>
<pre style="padding-left: 60px;">#cd /usr/ports/mail/postfix
#make all install clean
(Be sure “<span style="color: #ff0000;">DOVECOT</span>“, “<span style="color: #ff0000;">TLS</span>“, “BDB“, “<span style="color: #ff0000;">MySQL</span>“, and “<span style="color: #ff0000;">VDA</span>” are selected in the menu)</pre>
<p style="padding-left: 30px;"><em><strong>Note:</strong></em></p>
<p style="padding-left: 60px;">After the Postfix application is finished building and preparing to be finished installing, it will prompt you with a question similar to: Would you like to activate Postfix in /etc/mail/mailer.conf [n]? Press “<span style="color: #ff0000;">y</span>” and then continue with the install.</p>
<p style="padding-left: 30px;"><strong><em>Shut down Sendmail:</em></strong></p>
<pre style="padding-left: 60px;">#/etc/rc.d/sendmail forcestop</pre>
<p style="padding-left: 30px;"><strong><em>NOTE:</em></strong><br />
If the above command doesn’t not shut down Sendmail, you’ll have to manually kill the PIDs. You can either find the PIDs and kill them (2) individually or you can run the following command:</p>
<pre style="padding-left: 60px;">#sh
#for i in `ps auxwww|grep sendmail|awk '{print $2}'`;do kill $i;done &amp;&amp; exit</pre>
<p style="padding-left: 30px;"><strong><em>Edit /etc/rc.conf to disable Sendmail and start Postfix at boot:</em></strong><br />
Add these lines to the bottom of the file:</p>
<pre style="padding-left: 60px;">sendmail_enable="NO"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
postfix_enable="YES"</pre>
<p style="padding-left: 30px;"><strong><em>Create and edit /etc/periodic.conf file:</em></strong><br />
Add these lines to the file:</p>
<pre style="padding-left: 60px;">daily_clean_hoststat_enable="NO"
daily_status_mail_rejects_enable="NO"
daily_status_include_submit_mailq="NO"
daily_submit_queuerun="NO"</pre>
<p style="padding-left: 30px;"><strong><em>Create and secure the SMTP SSL certificate:</em></strong></p>
<pre style="padding-left: 60px;">#mkdir -p /etc/ssl/postfix
#cd /etc/ssl/postfix
#openssl req -new -x509 -nodes -out smtpd.pem -keyout smtpd.pem -days 3650
#chmod 640 /etc/ssl/postfix/smtpd.pem
#chgrp -R postfix /etc/ssl/postfix</pre>
<p style="padding-left: 30px;"><strong><em>Edit /usr/local/etc/postfix/main.cf file:</em></strong><br />
Find and edit the <span style="color: #ff0000;">RED TEXT</span>.</p>
<pre style="padding-left: 60px;">...
# SOFT BOUNCE
#
# The soft_bounce parameter provides a limited safety net for
# testing.  When soft_bounce is enabled, mail will remain queued that
# would otherwise bounce. This parameter disables locally-generated
# bounces, and prevents the SMTP server from rejecting mail permanently
# (by changing 5xx replies into 4xx replies). However, soft_bounce
# is no cure for address rewriting mistakes or mail routing mistakes.
#
<span style="color: #ff0000;">soft_bounce = no
# SASL CONFIG
#
broken_sasl_auth_clients = yes
smtpd_sender_restrictions = permit_sasl_authenticated, permit_mynetworks
smtpd_recipient_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
reject_non_fqdn_hostname,
reject_non_fqdn_sender,
reject_non_fqdn_recipient,
reject_unauth_destination,
reject_unauth_pipelining,
reject_invalid_hostname,
reject_rbl_client bl.spamcop.net,
<span style="color: #ff0000;">reject_rbl_client </span></span><span style="color: #ff0000;"><span class="body">zen.spamhaus.org</span></span>
<span style="color: #ff0000;">smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = yes
smtpd_sasl_local_domain = $myhostname
smtpd_sasl_security_options = noanonymous
smtpd_sasl_type = dovecot
smtpd_sasl_path = private/auth
# TLS CONFIG
#
smtp_use_tls = yes
smtpd_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtpd_tls_key_file = /etc/ssl/postfix/smtpd.pem
smtpd_tls_cert_file = /etc/ssl/postfix/smtpd.pem
smtpd_tls_CAfile = /etc/ssl/postfix/smtpd.pem
smtpd_tls_loglevel = 0
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom
# MySQL Configuration
#
virtual_alias_maps = proxy:mysql:/usr/local/etc/postfix/mysql_virtual_alias_maps.cf
virtual_gid_maps = static:125
virtual_mailbox_base = /usr/local/virtual
virtual_mailbox_domains = proxy:mysql:/usr/local/etc/postfix/mysql_virtual_domains_maps.cf
virtual_mailbox_limit = 51200000
virtual_mailbox_maps = proxy:mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_maps.cf
virtual_minimum_uid = 125
virtual_transport = virtual
virtual_uid_maps = static:125
# Additional for quota support
#
virtual_create_maildirsize = yes
virtual_mailbox_extended = yes
virtual_mailbox_limit_maps = proxy:mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_limit_maps.cf
proxy_read_maps = $local_recipient_maps $mydestination $virtual_alias_maps
$virtual_alias_domains $virtual_mailbox_maps $virtual_mailbox_domains
$relay_recipient_maps $relay_domains $canonical_maps $sender_canonical_maps
$recipient_canonical_maps $relocated_maps $transport_maps $mynetworks
$virtual_mailbox_limit_maps
virtual_mailbox_limit_override = yes
virtual_maildir_limit_message = Sorry, this user has overdrawn their diskspace quota. Please try again later.
virtual_overquota_bounce = yes</span>
...
myhostname = <span style="color: #ff0000;">host.domain.tld</span>
...
mydomain = <span style="color: #ff0000;">domain.tld</span>
...
mydestination = <span style="color: #ff0000;">localhost.$mydomain, localhost</span>
...
relay_domains = <span style="color: #ff0000;">proxy:mysql:/usr/local/etc/postfix/mysql_relay_domains_maps.cf</span>
...</pre>
<p style="padding-left: 30px;"><strong><em>Edit /usr/local/etc/postfix/master.cf file:</em></strong><br />
Find and edit the <span style="color: #ff0000;">RED TEXT</span>.</p>
<pre style="padding-left: 60px;">...
<span style="color: #ff0000;">smtps     inet  n       -       n       -       -       smtpd
-o smtpd_tls_wrappermode=yes
-o smtpd_sasl_auth_enable=yes
-o smtpd_client_restrictions=permit_sasl_authenticated,reject</span>
...</pre>
<p style="padding-left: 30px;"><strong><em>Create and edit<br />
/usr/local/etc/postfix/mysql_virtual_alias_maps.cf file:</em></strong></p>
<pre style="padding-left: 60px;">user = <span style="color: #ff0000;">postfix</span>
password = <span style="color: #ff0000;">postfix_sql_password</span>
hosts = <span style="color: #ff0000;">localhost</span>
dbname = <span style="color: #ff0000;">postfix</span>
query = <span style="color: #ff0000;">SELECT goto FROM alias WHERE address='%s' AND active = '1'</span></pre>
<p style="padding-left: 30px;"><strong><em>Create and edit<br />
/usr/local/etc/postfix/mysql_virtual_domains_maps.cf file:</em></strong></p>
<pre style="padding-left: 60px;">user = <span style="color: #ff0000;">postfix</span>
password = <span style="color: #ff0000;">postfix_sql_password</span>
hosts = <span style="color: #ff0000;">localhost</span>
dbname = <span style="color: #ff0000;">postfix</span>
query = <span style="color: #ff0000;">SELECT domain FROM domain WHERE domain='%s' and backupmx = '0' and active = '1'</span></pre>
<p style="padding-left: 30px;"><strong><em>Create and edit<br />
/usr/local/etc/postfix/mysql_virtual_mailbox_maps.cf file:</em></strong></p>
<pre style="padding-left: 60px;">user = <span style="color: #ff0000;">postfix</span>
password = <span style="color: #ff0000;">postfix_sql_password</span>
hosts = <span style="color: #ff0000;">localhost</span>
dbname = <span style="color: #ff0000;">postfix</span>
query = <span style="color: #ff0000;">SELECT maildir FROM mailbox WHERE username='%s' AND active = '1'</span></pre>
<p style="padding-left: 30px;"><strong><em>Create and edit<br />
/usr/local/etc/postfix/mysql_virtual_mailbox_limit_maps.cf file:</em></strong></p>
<pre style="padding-left: 60px;">user = <span style="color: #ff0000;">postfix</span>
password = <span style="color: #ff0000;">postfix_sql_password</span>
hosts = <span style="color: #ff0000;">localhost</span>
dbname = <span style="color: #ff0000;">postfix</span>
query = <span style="color: #ff0000;">SELECT quota FROM mailbox WHERE username='%s'</span></pre>
<p style="padding-left: 30px;"><strong><em>Create and edit<br />
/usr/local/etc/postfix/mysql_relay_domains_maps.cf file:</em></strong></p>
<pre style="padding-left: 60px;">user = <span style="color: #ff0000;">postfix</span>
password = <span style="color: #ff0000;">postfix_sql_password</span>
hosts = <span style="color: #ff0000;">localhost</span>
dbname = <span style="color: #ff0000;">postfix</span>
query = <span style="color: #ff0000;">SELECT domain FROM domain WHERE domain='%s' and backupmx = '1'</span></pre>
<p style="padding-left: 30px;"><strong><em>Secure Postfix’s MySQL files:</em></strong></p>
<pre style="padding-left: 60px;">#chmod 640 /usr/local/etc/postfix/mysql_*
#chgrp postfix /usr/local/etc/postfix/mysql_*</pre>
<p style="padding-left: 30px;"><strong><em>Update the transport map database:</em></strong></p>
<pre style="padding-left: 60px;">#postmap /usr/local/etc/postfix/transport</pre>
<p style="padding-left: 30px;"><strong><em>Edit /etc/aliases file:</em></strong></p>
<p style="padding-left: 60px;">Change &#8220;root&#8221; to an email address you want system messages to be mailed to:<br />
root: <span style="color: #ff0000;">you@your-domain.tld</span></p>
<p style="padding-left: 30px;"><strong><em>Create aliases.db file:</em></strong></p>
<pre style="padding-left: 60px;">#/usr/bin/newaliases</pre>
<p style="padding-left: 30px;"><strong><em>Create our virtual mail directories:</em></strong></p>
<pre style="padding-left: 60px;">#mkdir /usr/local/virtual
#chown -R postfix:postfix /usr/local/virtual
#chmod -R 700 /usr/local/virtual</pre>
<p><strong><em>4 &#8211; Apache Install</em></strong></p>
<p style="padding-left: 30px; ">Apache is a very robust, nice, and easily configurable web server application. I’ve been using it for many years and its always been kind to me. You can read more about Apache by visiting <a href="http://www.apache.org" target="_blank">http://www.apache.org</a>.</p>
<p style="padding-left: 30px; ">This tutorial installs version <strong>2.2.9</strong>.</p>
<p style="padding-left: 30px; "><strong><em>Install Apache via ports:</em></strong></p>
<pre style="padding-left: 60px; ">#cd /usr/ports/www/apache22
#make all install clean
(Menu defaults are fine)</pre>
<p style="padding-left: 30px; "><strong><em>Edit /usr/local/etc/apache22/httpd.conf file:</em></strong></p>
<p style="padding-left: 30px; ">Find and edit the <span style="color: #ff0000;">RED TEXT</span>.</p>
<pre style="padding-left: 60px; ">...
ServerAdmin <span style="color: #ff0000;">webmaster@domain.tld</span>
...
ServerName <span style="color: #ff0000;">www.domain.tld:80</span>
...
# Various default settings
<span style="color: #ff0000;">Include etc/apache22/extra/httpd-default.conf</span>
# Secure (SSL/TLS) connections
<span style="color: #ff0000;">Include etc/apache22/extra/httpd-ssl.conf</span>
...</pre>
<p style="padding-left: 30px; "><strong><em>Create SSL certificate for Apache:</em></strong></p>
<pre style="padding-left: 60px; ">#mkdir -p /etc/ssl/apache
#cd /etc/ssl/apache
#openssl genrsa -des3 -out server.key 1024
#openssl req -new -key server.key -out server.csr
#openssl x509 -req -days 365 -in server.csr -signkey server.key -out server.crt
#chmod 0400 /etc/ssl/apache/server.key
#chmod 0400 /etc/ssl/apache/server.crt</pre>
<p style="padding-left: 30px; "><strong><em>Remove SSL passphrase:</em></strong><br />
<strong><em><span style="font-style: normal; font-weight: normal; ">(This is entirely optional. I just had a lot of requests for this)</span></em></strong></p>
<pre style="padding-left: 60px; ">#cd /etc/ssl/apache
#cp server.key server.key.orig
#openssl rsa -in server.key.orig -out server.key</pre>
<p style="padding-left: 30px; "><strong><em>Protect our Apache key files:</em></strong></p>
<pre style="padding-left: 60px; ">#chmod 400 /etc/ssl/apache/*</pre>
<p style="padding-left: 30px; "><strong><em>Edit /usr/local/etc/apache22/extra/httpd-default.conf file:</em></strong></p>
<p style="padding-left: 30px; ">Find and edit the <span style="color: #ff0000;">RED TEXT</span>.</p>
<pre style="padding-left: 60px; ">...
ServerTokens <span style="color: #ff0000;">Prod</span>
...
ServerSignature <span style="color: #ff0000;">Off</span>
...
HostnameLookups <span style="color: #ff0000;">Off</span>
...</pre>
<p style="padding-left: 30px; "><strong><em>Edit /usr/local/etc/apache22/extra/httpd-ssl.conf file:</em></strong></p>
<pre style="padding-left: 60px; ">...
ServerName <span style="color: #ff0000;">www.domain.tld:443</span>
...
ServerAdmin <span style="color: #ff0000;">webmaster@domain.tld</span>
...
SSLCertificateFile "<span style="color: #ff0000;">/etc/ssl/apache/server.crt</span>"
...
SSLCertificateKeyFile "<span style="color: #ff0000;">/etc/ssl/apache/server.key</span>"
...</pre>
<p style="padding-left: 30px; "><strong><em>Install Apache startup script and start it:</em></strong></p>
<pre style="padding-left: 60px; ">#echo 'apache22_enable="YES"' &gt;&gt; /etc/rc.conf
#/usr/local/etc/rc.d/apache22 start</pre>
<p style="padding-left: 30px; "><strong><em>Test:</em></strong></p>
<p style="padding-left: 60px; ">Visiting either “<strong>http://domain.tld/</strong>” or “<strong>http://YOUR_IP/</strong>” should now bring up your machine’s default Apache web page (Something along the lines of “<strong>It Works!</strong>“. Then, visit either “<strong>https://domain.tld/</strong>” or “<strong>https://YOUR_IP/</strong>” to test the SSL/TLS. If you see both pages, you’re ready to rock. If not, browse to the top of this Apache Install page and try again. Also, be sure to check your logs to find out if there are any errors. The logs will be located in “<strong>/var/log/httpd-*</strong>” by default. Seriously, I cannot stress checking logs enough…</p>
<p><strong><em>5 &#8211; PHP Install</em></strong></p>
<p style="padding-left: 30px; ">PHP is a very powerful language used mostly for web applications. Hence the reason we are installing it. Each application that is accessible via the web in this tutorial depends on PHP to work properly. You can check out more on PHP by visiting their web site at <a href="http://www.php.net" target="_blank">http://www.php.net</a>.</p>
<p style="padding-left: 30px; ">This tutorial installs version <strong>5.2.6</strong>.</p>
<p style="padding-left: 30px; "><strong><em>Install PHP via ports:</em></strong></p>
<pre style="padding-left: 60px; ">#cd /usr/ports/lang/php5
#make all install clean (Be sure “<span style="color: #ff0000;">APACHE</span>” is selected in the menu)</pre>
<p style="padding-left: 30px; "><strong><em>Install PHP extentions:</em></strong></p>
<pre style="padding-left: 60px; ">#cd /usr/ports/lang/php5-extensions
#make all install clean
(Be sure “<span style="color: #ff0000;">BCMATH</span>“, “<span style="color: #ff0000;">GETTEXT</span>“, “<span style="color: #ff0000;">IMAP</span>“, “<span style="color: #ff0000;">MCRYPT</span>“, “<span style="color: #ff0000;">MYSQL</span>“, “<span style="color: #ff0000;">MYSQLI</span>“, “<span style="color: #ff0000;">SESSION</span>“, “<span style="color: #ff0000;">SOCKETS</span>“, and “<span style="color: #ff0000;">WDDX</span>” are selected in the menu)</pre>
<p style="padding-left: 30px; "><strong><em>Prepare /usr/local/etc/php.ini file:</em></strong></p>
<pre style="padding-left: 60px; ">#cp /usr/local/etc/php.ini-recommended /usr/local/etc/php.ini</pre>
<p style="padding-left: 30px; "><strong><em>Edit /usr/local/etc/php.ini file:</em></strong></p>
<p style="padding-left: 30px; ">Find and edit the <span style="color: #ff0000;">RED TEXT</span>.</p>
<pre style="padding-left: 60px; ">...
;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;
; UNIX: "/path1:/path2"
<span style="color: #ff0000;">include_path = "."</span>
;
; Windows: "\path1;\path2"
;include_path = ".;c:\php\includes"
...</pre>
<p style="padding-left: 30px; "><strong><em>Edit /usr/local/etc/apache22/httpd.conf file:</em></strong></p>
<p style="padding-left: 30px; ">Find and edit the <span style="color: #ff0000;">RED TEXT</span>.</p>
<pre style="padding-left: 60px; ">...
&lt;IfModule dir_module&gt;
DirectoryIndex index.html <span style="color: #ff0000;">index.php index.php5</span>
&lt;/IfModule&gt;
...
...
&lt;IfModule mime_module&gt;
TypesConfig etc/apache22/mime.types
AddType application/x-compress .Z
AddType application/x-gzip .gz .tgz
<span style="color: #ff0000;">AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps</span>
&lt;/IfModule&gt;</pre>
<p style="padding-left: 30px; "><strong><em>Restart Apache:</em></strong></p>
<pre style="padding-left: 60px; ">#apachectl restart</pre>
<p><strong><em>6 &#8211; Postfixadmin Install</em></strong></p>
<p style="padding-left: 30px; ">PostfixAdmin is a great application to edit your e-mail domains and users. It has plenty of options and makes things very easy. You can check it out by visiting their website at <a href="http://sourceforge.net/projects/postfixadmin" target="_blank">http://sourceforge.net/projects/postfixadmin</a>.</p>
<p style="padding-left: 30px; ">This tutorial installs version <strong>2.2.1.1</strong>.</p>
<p style="padding-left: 30px; "><strong><em>Install Postfixadmin via ports:</em></strong></p>
<pre style="padding-left: 60px; ">#cd /usr/ports/mail/postfixadmin
#make all install clean
(Be sure “<span style="color: #ff0000;">MYSQLI</span>” is selected in the menu.)</pre>
<p style="padding-left: 30px; "><strong><em>Create PostfixAdmin database:</em></strong></p>
<p style="padding-left: 30px; ">Execute adjusting the <span style="color: #ff0000;">RED TEXT</span>.</p>
<pre style="padding-left: 60px; ">#mysql -u root -p
(Enter MySQL root password)
&gt;CREATE DATABASE postfix;
&gt;CREATE USER 'postfix'@'localhost' IDENTIFIED BY '<span style="color: #ff0000;">postfix_sql_password</span>';
&gt;GRANT ALL PRIVILEGES ON `postfix` . * TO 'postfix'@'localhost';
&gt;FLUSH PRIVILEGES;</pre>
<p style="padding-left: 30px; "><strong><em>Secure PostfixAdmin files:</em></strong></p>
<pre style="padding-left: 60px; ">#cd /usr/local/www/postfixadmin
#find . -type f -exec chmod 640 {} \;
#find . -type d -exec chmod 750 {} \;</pre>
<p style="padding-left: 30px; "><strong><em>Edit /usr/local/www/postfixadmin/config.inc.php file:</em></strong></p>
<p style="padding-left: 30px; ">Find and edit the <span style="color: #ff0000;">RED TEXT</span>.</p>
<pre style="padding-left: 60px; ">$CONF['configured'] = <span style="color: #ff0000;">true</span>;
$CONF['postfix_admin_url'] = '<span style="color: #ff0000;">https://www.domain.tld/postfixadmin/</span>';
$CONF['database_type'] = '<span style="color: #ff0000;">mysqli</span>';
$CONF['database_host'] = '<span style="color: #ff0000;">localhost</span>';
$CONF['database_user'] = '<span style="color: #ff0000;">postfix</span>';
$CONF['database_password'] = '<span style="color: #ff0000;">postfix_sql_password</span>';
$CONF['database_name'] = '<span style="color: #ff0000;">postfix</span>';
$CONF['database_prefix'] = '';
$CONF['admin_email'] = '<span style="color: #ff0000;">postmaster@domain.tld</span>';
$CONF['default_aliases'] = array (
   'abuse' =&gt; '<span style="color: #ff0000;">abuse@domain.tld</span>',
   'hostmaster' =&gt; '<span style="color: #ff0000;">hostmaster@domain.tld</span>',
   'postmaster' =&gt; '<span style="color: #ff0000;">postmaster@domain.tld</span>',
   'webmaster' =&gt; '<span style="color: #ff0000;">webmaster@domain.tld</span>'
);
$CONF['generate_password'] = '<span style="color: #ff0000;">NO</span>';
$CONF['page_size'] = '<span style="color: #ff0000;">20</span>';
$CONF['domain_path'] = '<span style="color: #ff0000;">YES</span>';
$CONF['domain_in_mailbox'] = '<span style="color: #ff0000;">NO</span>';
$CONF['aliases'] = '<span style="color: #ff0000;">50</span>';
$CONF['mailboxes'] = '<span style="color: #ff0000;">50</span>';
$CONF['maxquota'] = '<span style="color: #ff0000;">1024</span>';
$CONF['quota'] = '<span style="color: #ff0000;">YES</span>';
$CONF['quota_multiplier'] = '<span style="color: #ff0000;">1048576</span>';
$CONF['transport'] = '<span style="color: #ff0000;">NO</span>';
$CONF['vacation'] = '<span style="color: #ff0000;">YES</span>';
$CONF['vacation_domain'] = '<span style="color: #ff0000;">autoreply.domain.tld</span>';
$CONF['alias_control_admin'] = '<span style="color: #ff0000;">YES</span>';
$CONF['special_alias_control'] = '<span style="color: #ff0000;">YES</span>';
$CONF['show_header_text'] = '<span style="color: #ff0000;">YES</span>';
$CONF['header_text'] = '<span style="color: #ff0000;">:: Postfix Admin ::</span>';
$CONF['show_footer_text'] = '<span style="color: #ff0000;">YES</span>';
$CONF['footer_text'] = '<span style="color: #ff0000;">Return to domain.tld</span>';
$CONF['user_footer_link'] = '<span style="color: #ff0000;">http://www.domain.tld/</span>';
$CONF['welcome_text'] = &lt;&lt;&lt;EOM
<span style="color: #ff0000;">Hello,

</span></pre>
<pre style="padding-left: 60px; "><span style="color: #ff0000;">Welcome to your new email account!
For questions or comments regarding your mail account,
please feel free to send an email to support@domain.tld.
Likewise, any other inqueries regarding ISP NAME or their
affiliates can be sent to the same address.

</span></pre>
<pre style="padding-left: 60px; "><span style="color: #ff0000;">Also, don't forget to check your mail settings via Maia-
Mailguard located at https://www.domain.tld/maia-mailguard/.
Simply log into your account using your email address
and password. That's it! From Maia-Mailguard, you can
adjust your spam, virus, malware, whitelists, blacklists,
etc... This will put you in full control of your email so
you never miss anything important.

</span></pre>
<pre style="padding-left: 60px; "><span style="color: #ff0000;">Thank you for using ISP NAME and enjoy your new email
account!</span></pre>
<pre style="padding-left: 60px; "><span style="color: #ff0000;">Regards,
ISP NAME Staff
support@domain.tld</span>
EOM;
?&gt;</pre>
<p style="padding-left: 30px; "><strong><em>Create Vacation user and group accounts:</em></strong></p>
<pre style="padding-left: 60px; ">#pw groupadd vacation
#pw useradd vacation -c Virtual\ Vacation -d /nonexistent -g vacation -s /sbin/nologin</pre>
<p style="padding-left: 30px; "><strong><em>Create, populate and secure vacation directory:</em></strong></p>
<pre style="padding-left: 60px; ">#mkdir /var/spool/vacation
#cp /usr/local/www/postfixadmin/VIRTUAL_VACATION/vacation.pl /var/spool/vacation/
#chown -R vacation:vacation /var/spool/vacation/
#chmod 700 /var/spool/vacation/
#chmod 750 /var/spool/vacation/vacation.pl
#touch /var/log/vacation.log /var/log/vacation-debug.log
#chown vacation:vacation /var/log/vacation*</pre>
<p style="padding-left: 30px; "><strong><em>Edit /var/spool/vacation/vacation.pl script:</em></strong></p>
<p style="padding-left: 30px; ">Find and edit the <span style="color: #ff0000;">RED TEXT</span>.</p>
<pre style="padding-left: 60px; ">my $db_type = '<span style="color: #ff0000;">mysql</span>';
my $db_host = '<span style="color: #ff0000;">localhost</span>';
my $db_user = '<span style="color: #ff0000;">postfix</span>';
my $db_pass = '<span style="color: #ff0000;">postfix_sql_password</span>';
my $db_name = '<span style="color: #ff0000;">postfix</span>';
my $sendmail = "<span style="color: #ff0000;">/usr/sbin/sendmail</span>";
my $logfile = "<span style="color: #ff0000;">/var/log/vacation.log</span>";    # specify a file name here for example: vacation.log
my $debugfile = "<span style="color: #ff0000;">/var/log/vacation-debug.log</span>";  # sepcify a file name here for example: vacation.debug
my $syslog = <span style="color: #ff0000;">1</span>;   # 1 if log entries should be sent to syslog
...</pre>
<p style="padding-left: 30px; "><strong><em>Edit /usr/local/etc/postfix/master.cf for vacation filter:</em></strong><br />
Add this to the bottom of the file.</p>
<pre style="padding-left: 30px; ">vacation  unix  -       n       n       -       -       pipe
   flags=DRhu user=vacation argv=/var/spool/vacation/vacation.pl</pre>
<p style="padding-left: 30px; "><strong><em>Edit /usr/local/etc/postfix/main.cf for vacation transport:</em></strong></p>
<p style="padding-left: 30px; ">Find and edit the <span style="color: #ff0000;">RED TEXT</span>.</p>
<pre style="padding-left: 60px; ">...
# TRANSPORT MAP
#
# See the discussion in the ADDRESS_REWRITING_README document.
<span style="color: #ff0000;">transport_maps = hash:/usr/local/etc/postfix/transport
vacation_destination_recipient_limit = 1</span>
...</pre>
<p style="padding-left: 30px; "><strong><em>Add proper lines to /usr/local/etc/postfix/transport file:</em></strong></p>
<pre style="padding-left: 60px; ">#echo 'autoreply.domain.tld vacation:' &gt;&gt; /usr/local/etc/postfix/transport</pre>
<p style="padding-left: 30px; "><strong><em>Create our transport map database for Postfix:</em></strong></p>
<pre style="padding-left: 60px; ">#postmap /usr/local/etc/postfix/transport</pre>
<p style="padding-left: 30px; "><strong><em>Create and edit /usr/local/etc/apache22/Includes/postfixadmin.conf file:</em></strong></p>
<pre style="padding-left: 60px; ">Alias /postfixadmin/ "/usr/local/www/postfixadmin/"
&lt;Directory "/usr/local/www/postfixadmin/"&gt;
   Options Indexes
   AllowOverride AuthConfig
   Order allow,deny
   Allow from all
&lt;/Directory&gt;</pre>
<p style="padding-left: 30px; "><strong><em>Reload Apache configuration:</em></strong></p>
<pre style="padding-left: 60px; ">#apachectl configtest
#apachectl graceful</pre>
<p style="padding-left: 30px; "><strong><em>Run all startup scripts:</em></strong></p>
<pre style="padding-left: 60px; ">#/usr/local/etc/rc.d/mysql-server start (Should already be running?)
#/usr/local/etc/rc.d/dovecot start
#/usr/local/etc/rc.d/postfix start</pre>
<p style="padding-left: 30px; "><strong><em>Note:</em></strong></p>
<p style="padding-left: 60px; ">Check your <strong>/var/log/maillog</strong> and <strong>/var/log/messages</strong> to make sure there are no errors.</p>
<p style="padding-left: 30px; "><strong><em>Post Note:</em></strong></p>
<p style="padding-left: 60px; ">If you are receiving errors in your logs about $mydestination, be sure that _ANY_ ‘virtual’ domain you are hosting is _NOT_ listed in your /etc/hosts file. Apparently this causes a problem being as Postfix cannot determine if the domain is virtual or not. (Thanks Valentin)</p>
<p style="padding-left: 30px; "><strong><em>Test and setup PFA admin:</em></strong></p>
<p style="padding-left: 60px; ">Visit “<strong>http://domain.tld/postfixadmin/</strong>. Click the “<strong>setup</strong>” link in the text and read through the output to make sure there are no problems. Toward the bottom, you should be prompted for an e-mail address and password for an ‘Administror’ account in PostfixAdmin. You can use whatever e-mail address and password you would like here. Be sure to choose something you plan on actually adding to PostfixAdmin later though as you may end up getting messages from PFA later. After you add the ‘Administrator’ account, you should see “<strong>Everything seems fine… you are ready to rock &amp; roll!</strong>” toward the bottom of the setup.php page. If so, <strong>delete /usr/local/www/postfixadmin/setup.php</strong> (Or move it. Your choice)</p>
<p style="padding-left: 30px; "><strong><em>Add a domain and user to Postfix:</em></strong></p>
<p style="padding-left: 60px; ">Visit “<strong>http://domain.tld/postfixadmin/</strong>”</p>
<p style="padding-left: 60px; ">Enter the <span style="color: #ff0000;">admin </span>username and password you created during the PostfixAdmin setup. Click “<strong>Domain List</strong>” then “<strong>New Domain</strong>“and fill in the requested fields. Next, click “<strong>Virtual List</strong>” followed by “<strong>Add Mailbox</strong>“and again, fill in the requested fields.</p>
<p style="padding-left: 30px; "><strong><em>Telnet to localhost on port 25:</em></strong></p>
<pre style="padding-left: 60px; ">#telnet localhost 25
Trying 127.0.0.1…
Connected to localhost.domain.tld.
Escape character is ‘^]’.
220 test.domain.tld ESMTP Postfix
<span style="color: #ff0000;">EHLO test.com</span>
250-test.domain.tld
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH LOGIN PLAIN
250-AUTH=LOGIN PLAIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
<span style="color: #ff0000;">STARTTLS</span>
220 2.0.0 Ready to start TLS
<span style="color: #ff0000;">quit
quit</span></pre>
<p style="padding-left: 30px; "><strong><em>Telnet to localhost on port 465:</em></strong></p>
<pre style="padding-left: 60px; ">#telnet localhost 465
Trying 127.0.0.1…
Connected to host.domain.tld.
Escape character is ‘^]’.
<span style="color: #ff0000;">quit
quit</span></pre>
<p style="padding-left: 30px; "><strong><em>Note:</em></strong></p>
<p style="padding-left: 60px; ">You won’t see anything besides the above on port 465 as it requires SSL and you’re not using it right now. So, if the connection is successful, you should be fine. You can test this later with a mail client using an SSL connection for SMTP.</p>
<p style="padding-left: 30px; "><strong><em>Telnet to localhost on port 110:</em></strong></p>
<pre style="padding-left: 60px; ">#telnet localhost 110
Connected to host.domain.tld.
Escape character is ‘^]’.
+OK ISP Mail Server Ready.
<span style="color: #ff0000;">user user@domain.tld</span> (Use the account you created via the web interface)
+OK
<span style="color: #ff0000;">pass password</span> (Use password you just created for above user)
+OK Logged in.
<span style="color: #ff0000;">list</span>
+OK 1 messages:
1 844
.
<span style="color: #ff0000;">quit</span>
+OK Logging out
Connection closed by foreign host.</pre>
<p style="padding-left: 60px; ">Check your <strong>/var/log/maillog</strong> for errors. If there are none, congratulations. You now have a complete Postfix+Virtual-Users/Domains installation.</p>
<p><strong>7 &#8211; SpamAssassin Install</strong></p>
<p style="padding-left: 30px;">SpamAssassin is a great tool for detecting spam. Although it may be a bit ‘bloated’ and resource hungry, I still like to use it. Whether or not you want to use it is up to you. I’ve heard of others trading this step out for spamd but I haven’t gotten around to integrating it properly. So, SpamAssassin it is! You can read more about SpamAssassin by visiting their web site at <a href="http://spamassassin.apache.org" target="_blank">http://spamassassin.apache.org</a>.</p>
<p style="padding-left: 30px;">This tutorial installs version <strong>3.2.5</strong>.</p>
<p style="padding-left: 30px;"><strong><em>Install SpamAssassin via ports:</em></strong></p>
<pre style="padding-left: 60px;">#cd /usr/ports/mail/p5-Mail-SpamAssassin
#make all install clean
(Be sure “SPAMC” is NOT selected and “GNUPG“, “MYSQL“, and “RAZOR” are selected in the menu)</pre>
<p style="padding-left: 30px;"><strong><em>Create user “vscan”:</em></strong></p>
<pre style="padding-left: 60px;">#pw groupadd vscan
#pw useradd -n vscan -c Amavisd\ User -d /var/amavisd -g vscan -m
#passwd vscan
(Enter password twice)</pre>
<p style="padding-left: 30px;"><strong><em>Create and edit /usr/local/etc/mail/spamassassin/local.cf file:</em></strong></p>
<pre style="padding-left: 60px;">use_bayes 1
bayes_store_module Mail::SpamAssassin::BayesStore::MySQL
bayes_sql_dsn DBI:mysql:maia
bayes_sql_username vscan
bayes_sql_password <span style="color: #ff0000;">vscan_password</span>
auto_whitelist_factory Mail::SpamAssassin::SQLBasedAddrList
user_awl_dsn DBI:mysql:maia
user_awl_sql_username vscan
user_awl_sql_password vscan_password
bayes_auto_expire 0</pre>
<pre style="padding-left: 60px;"># Change 192.168.1.* to your actual internal/external address(es).</pre>
<pre style="padding-left: 60px;">internal_networks <span style="color: #ff0000;">192.168.1.0/24</span>
trusted_networks <span style="color: #ff0000;">192.168.1/24</span></pre>
<p style="padding-left: 30px;"><strong><em>Configure RAZOR for reporting:</em></strong></p>
<pre style="padding-left: 60px;">#su - vscan
#razor-admin -discover
#razor-admin -create
#razor-admin -register -l -user=username@domain.tld -pass=some_password
#exit</pre>
<p style="padding-left: 30px;"><strong><em>NOTE:</em></strong></p>
<p style="padding-left: 60px;">The above user should be an actual email address you check. The password can be any password you’d like. It’s only needed by razor2 to identify and report and spam.</p>
<p><strong>8 &#8211; FuzzyOCR Install</strong></p>
<p style="padding-left: 30px;">FuzzyOCR is a tool that detects spam inside of images. This tool works wonderfully and I would highly recommend using it. You can find out more by visiting the FuzzyOCR web site at <a href="http://fuzzyocr.own-hero.net" target="_blank">http://fuzzyocr.own-hero.net</a>.</p>
<p style="padding-left: 30px;">This tutorial installs version <strong>3.4.2_2</strong>.</p>
<p style="padding-left: 30px;"><strong><em>Install FuzzyOCR via ports:</em></strong></p>
<pre style="padding-left: 60px;">#cd /usr/ports/mail/p5-FuzzyOcr-devel
#make all install clean</pre>
<p style="padding-left: 30px;"><strong><em>Copy FuzzyOcr files to SpamAssassin configuration directory:</em></strong></p>
<pre style="padding-left: 60px;">#cp /usr/local/share/examples/FuzzyOcr/FuzzyOcr.* /usr/local/etc/mail/spamassassin</pre>
<p><strong>9 &#8211; Clam Anti-Virus Install</strong></p>
<p style="padding-left: 30px;">Clam Anti-Virus is a free virus scanning utility that works like a charm. Thus far I haven’t had any issues with it. You can also install many other AV scanners that Maia-Mailguard can use. You are not limited to one. You can read more about ClamAV by visiting the web site at <a href="http://www.clamav.net" target="_blank">http://www.clamav.net</a>.</p>
<p style="padding-left: 30px;">This tutorial installs version <strong>0.93.3</strong>.</p>
<p style="padding-left: 30px;"><strong><em>Install Clam Anti-Virus via ports:</em></strong></p>
<pre style="padding-left: 60px;">#cd /usr/ports/security/clamav
#make all install clean CLAMAVUSER=vscan CLAMAVGROUP=vscan
(Menu defaults should be fine.)</pre>
<p style="padding-left: 30px;"><strong><em>Add build options to /etc/make.conf file:</em></strong></p>
<p style="padding-left: 30px;">This will keep you from having to use those build options every time you upgrade your ClamAV port.</p>
<pre style="padding-left: 60px;">#echo 'CLAMAVUSER=vscan' &gt;&gt; /etc/make.conf
#echo 'CLAMAVGROUP=vscan' &gt;&gt; /etc/make.conf</pre>
<p style="padding-left: 30px;"><strong><em>Enable ClamAV at boot time:</em></strong></p>
<pre style="padding-left: 60px;">#echo 'clamav_freshclam_enable="YES"' &gt;&gt; /etc/rc.conf
#echo 'clamav_clamd_enable="YES"' &gt;&gt; /etc/rc.conf</pre>
<p style="padding-left: 30px;"><strong><em>Start FreshClam as well as the ClamAV daemon:</em></strong></p>
<pre style="padding-left: 60px;">#/usr/local/etc/rc.d/clamav-clamd start
#/usr/local/etc/rc.d/clamav-freshclam start</pre>
<p><strong>10 &#8211; PEAR Install</strong></p>
<p>PEAR stands for “PHP Extension and Application Repository” which describes it perfectly. It comes in very handy when dealing with web applications. You can read more about PEAR at <a href="http://pear.php.net">http://pear.php.net</a>.</p>
<p>This tutorial installs version <strong>1.7.2</strong>.</p>
<p><strong><em>Install PEAR via ports:</em></strong></p>
<pre style="padding-left: 30px;">#cd /usr/ports/devel/pear
#make all install clean</pre>
<p><strong><em>Edit /usr/local/etc/php.ini file:</em></strong></p>
<p>Find and edit the <span style="color: #ff0000;">RED TEXT</span></p>
<pre style="padding-left: 30px;">...
;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;
; UNIX: "/path1:/path2"
include_path = "<span style="color: #ff0000;">.:/usr/local/share/pear</span>"
;
; Windows: "\path1;\path2"
;include_path = ".;c:\php\includes"
...</pre>
<p><strong><em>11 &#8211; Maia-Mailguard Install</em></strong></p>
<p style="padding-left: 30px;">Maia-Mailguard is by far the best open source spam/virus configuration utility I have ever used. It allows users to adjust their own settings for spam and viruses leaving the Mail Admin a little breathing room which makes it a great piece of software. You can read more about it at <a href="http://www.maiamailguard.com" target="_blank">http://www.maiamailguard.com</a>.</p>
<p style="padding-left: 30px;">This tutorial installs version <strong>1.0.2a_1</strong>.</p>
<p style="padding-left: 30px;"><strong><em>Install Maia-Mailguard via ports:</em></strong></p>
<pre style="padding-left: 60px;">#cd /usr/ports/security/maia
#make all install clean
(Menu defaults will be fine. However, feel free to add more apps for the scanner. It can’t hurt)</pre>
<p style="padding-left: 30px;"><strong><em>Create and populate Maia-Mailguard database:</em></strong></p>
<pre style="padding-left: 60px;">#mysql -u root -p mysql
(Enter MySQL root password)
&gt;CREATE DATABASE maia;
&gt;GRANT ALL PRIVILEGES ON maia.* TO vscan@localhost IDENTIFIED BY ‘<span style="color: #ff0000;">vscan_password</span>‘;
&gt;FLUSH PRIVILEGES;
&gt;quit
#cd /usr/local/share/doc/maia
#mysql -u root -p maia &lt; maia-mysql.sql</pre>
<p style="padding-left: 30px;"><strong><em>Edit /usr/local/etc/maia.conf file:</em></strong></p>
<p style="padding-left: 30px;">Find and edit the <span style="color: #ff0000;">RED TEXT</span></p>
<pre style="padding-left: 60px;">…
# Your Maia database user’s login name
$username = “<span style="color: #ff0000;">vscan</span>“;
# Your Maia database user’s password
$password = “<span style="color: #ff0000;">vscan_password</span>“;
# The directory where Maia’s Perl scripts can be found.
$script_dir = “<span style="color: #ff0000;">/var/amavisd/maia/scripts</span>“;
…
# The directory where SpamAssassin’s local.cf file can be found.
$local_cf_dir = “<span style="color: #ff0000;">/usr/local/etc/mail/spamassassin</span>“; # default: let the script find it
…
# The directory where SpamAssassin’s core rules can be found.
$system_rules_dir = “<span style="color: #ff0000;">/usr/local/share/spamassassin</span>“; # default: let the script find it
…
# The directory where your amavis user’s user_prefs file can be found.
$user_rules_dir = “<span style="color: #ff0000;">/var/amavisd/.spamassassin</span>“; # default: let the script find it
…
# Location of your encryption key file, or undef to disable
#$key_file = “<span style="color: #ff0000;">/var/amavisd/maia.key</span>”;
…
# Base URL to Maia’s PHP scripts
$base_url = “<span style="color: #ff0000;">https://www.domain.tld/maia/</span>“;</pre>
<p style="padding-left: 30px;"><strong><em>Run configtest.pl executable:</em></strong></p>
<pre style="padding-left: 60px;">#/var/amavisd/maia/scripts/configtest.pl</pre>
<p style="padding-left: 30px;"><strong>Note:</strong></p>
<p style="padding-left: 60px;">There is a known issue with the ‘file()’ utility in the configtest check. Don’t worry about this as Maia will still find and use file() even if the configtest says it is not installed. This will be fixed in the next Maia release. Otherwise, PLEASE let me know if something in the port is not working correctly.</p>
<p style="padding-left: 30px;"><strong><em>Allow ‘vscan’ access to Maia’s files:</em></strong></p>
<pre style="padding-left: 60px;">#cd /usr/local/etc
#chgrp vscan maia.conf amavisd.conf</pre>
<p style="padding-left: 30px;"><strong><em>Load SpamAssassin rules:</em></strong></p>
<pre style="padding-left: 60px;">#su - vscan
#/var/amavisd/maia/scripts/load-sa-rules.pl --debug
#exit</pre>
<p style="padding-left: 30px;"><strong><em>Install Smarty Engine Template via ports:</em></strong></p>
<pre style="padding-left: 60px;">#cd /usr/ports/www/smarty
#make all install clean</pre>
<p style="padding-left: 30px;"><strong><em>Edit /usr/local/etc/php.ini file:</em></strong></p>
<p style="padding-left: 30px;">Find and edit the <span style="color: #ff0000;">RED TEXT</span></p>
<pre style="padding-left: 60px;">…
;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;
; UNIX: “/path1:/path2″
include_path = “.:/usr/local/share/pear<span style="color: #ff0000;">:/usr/local/share/smarty</span>”
;
; Windows: “\path1;\path2″
;include_path = “.;c:\php\includes”
…</pre>
<p style="padding-left: 30px;"><strong><em>Reload Apache’s configuration files:</em></strong></p>
<pre style="padding-left: 60px;">#apachectl graceful</pre>
<p style="padding-left: 30px;"><em><strong>Edit /usr/local/www/maia/config.php file:</strong></em></p>
<p style="padding-left: 30px;">Find and edit the <span style="color: #ff0000;">RED TEXT</span>.</p>
<pre style="padding-left: 60px;">…
$maia_sql_dsn = “mysql://vscan:vscan_password@unix(/tmp/mysql.sock)/maia“;
…
$address_rewriting_type = 4;
…
$auth_method = “sql“;
…
// Database connection string to use for authentication.
$auth_sql_dsn = “mysql://postfix:postfix_sql_password@unix(/tmp/mysql.sock)/postfix“;
…
// Name of the table that contains the user’s authentication info
$auth_sql_table = “mailbox“;
…
// Name of the column that contains the user’s name
$auth_sql_username_column = “username“;
…
// Name of the column that contains the user’s password
$auth_sql_password_column = “password“;
…
// Name of the column that contains the user’s e-mail address
$auth_sql_email_column = “username“;
…
// Password encryption type:
$auth_sql_password_type = “crypt“;
…</pre>
<p style="padding-left: 30px;"><strong><em>Create and edit /usr/local/etc/apache22/Includes/maia.conf file:</em></strong></p>
<pre style="padding-left: 60px;">Alias /maia/ "/usr/local/www/maia/"
&lt;Directory "/usr/local/www/maia/"&gt;
   AllowOverride None
   Options None
   Order allow,deny
   Allow from all
&lt;/Directory&gt;</pre>
<p style="padding-left: 30px;"><strong><em>Reload Apache:</em></strong></p>
<pre style="padding-left: 60px;">#apachectl graceful</pre>
<p style="padding-left: 30px;"><strong><em>Test:</em></strong></p>
<p style="padding-left: 60px;">Visit “<strong>https://domain.tld/maia/admin/configtest.php</strong>“.</p>
<p style="padding-left: 60px;">You’ll see we’re still missing plenty of PEAR modules. So, let’s go a head and install those. Of course, all “optional” modules are your decision.</p>
<p style="padding-left: 30px;"><strong><em>Install PEAR::Mail_Mime via ports:</em></strong></p>
<pre style="padding-left: 60px;">#cd /usr/ports/mail/pear-Mail_Mime
#make all install clean</pre>
<p style="padding-left: 30px;"><strong><em>Install PEAR::Mail_mimeDecode via ports:</em></strong></p>
<pre style="padding-left: 60px;">#cd /usr/ports/mail/pear-Mail_mimeDecode
#make all install clean</pre>
<p style="padding-left: 30px;"><strong><em>Install PEAR::DB via ports:</em></strong></p>
<pre style="padding-left: 60px;">#cd /usr/ports/databases/pear-DB
#make all install clean</pre>
<p style="padding-left: 30px;"><strong><em>Install PEAR::Pager via ports:</em></strong></p>
<pre style="padding-left: 60px;">#cd /usr/ports/devel/pear-Pager
#make all install clean</pre>
<p style="padding-left: 30px;"><strong><em>Install PEAR::Net_Socket via ports:</em></strong></p>
<pre style="padding-left: 60px;">#cd /usr/ports/net/pear-Net_Socket
#make all install clean</pre>
<p style="padding-left: 30px;"><strong><em>Install PEAR::Net_SMTP via ports:</em></strong></p>
<pre style="padding-left: 60px;">#cd /usr/ports/net/pear-Net_SMTP
#make all install clean
(Be sure “PEAR_AUTH_SASL” is selected from the menu)</pre>
<p style="padding-left: 30px;"><strong><em>Install PEAR::Log via ports:</em></strong></p>
<pre style="padding-left: 60px;">#cd /usr/ports/sysutils/pear-Log
#make all install clean
(Be sure “Pear_DB” is selected from the menu)</pre>
<p style="padding-left: 30px;"><strong><em>NOTE:</em></strong></p>
<p style="padding-left: 60px;">If you would like to have the image graph utilities available in Maia, you can find all the modules you need in /usr/ports/graphics and /usr/ports/textproc.</p>
<p style="padding-left: 60px;">(As of this writing):<br />
PEAR::Image_Color<br />
PEAR::Image_Canvas<br />
PEAR::Image_Graph<br />
PEAR::Numbers_Roman<br />
PEAR::Numbers_Words</p>
<p style="padding-left: 60px;">So, go for it if you want to. These, however, are in no way required.</p>
<p style="padding-left: 30px;"><strong><em>Patch pear-Net_IMAP:</em></strong></p>
<p style="padding-left: 30px;"><strong><em>NOTE:</em></strong> This is only for those of you who chose to install the graphical imaging software with PEAR. <strong><em>IF YOU DID NOT INSTALL GRAPHS, SKIP THIS STEP.</em></strong></p>
<pre style="padding-left: 60px;">#cd /usr/local/share/pear
#fetch http://www.purplehat.org/downloads/postfix_guide/Pie.php.diff
#patch -p0 &lt; Pie.php.diff</pre>
<p style="padding-left: 30px;"><strong><em>Reload Apache Configuration:</em></strong></p>
<pre style="padding-left: 60px;">#apachectl graceful</pre>
<p style="padding-left: 30px;"><strong><em>Edit /usr/local/etc/amavisd.conf file:</em></strong></p>
<p style="padding-left: 30px;">Find and edit the <span style="color: #ff0000;">RED TEXT</span>.</p>
<pre style="padding-left: 60px;">...
$max_servers = 2;             # number of pre-forked children (2..15 is common)
...
$mydomain = 'domain.tld';
...
#$key_file = "$MYHOME/maia.key";
...
$DO_SYSLOG = 1;
...
@lookup_sql_dsn = ( ['DBI:mysql:maia:localhost', 'vscan', 'vscan_password'] );
...
$unrar = ['rar', 'unrar'];
...
$myhostname = 'host.domain.tld';
...
$X_HEADER_LINE = "Maia Mailguard";
...
### http://www.clamav.net/
['ClamAV-clamd',
  \&amp;ask_daemon, ["CONTSCAN {}\n", "/var/run/clamav/clamd.sock"],
  qr/\bOK$/, qr/\bFOUND$/,
  qr/^.*?: (?!Infected Archive)(.*) FOUND$/ ],
...</pre>
<p style="padding-left: 30px;"><strong><em>Set Maia-Mailguard to start at boot and start it now:</em></strong></p>
<pre style="padding-left: 60px;">#echo 'maia_enable="YES"' &gt;&gt; /etc/rc.conf
#/usr/local/etc/rc.d/maia start</pre>
<p style="padding-left: 30px;"><strong><em>Test:</em></strong></p>
<p style="padding-left: 60px;">Visit “<strong>https://domain.tld/maia/</strong>“. You should be greeted with a login screen. If so, great! Let’s log in and acquire admin privileges…</p>
<p style="padding-left: 60px;">Instead of “<strong>https://domain.tld/maia/login.php</strong>” (The default), visit “<strong>https://domain.tld/maia/login.php?super=register</strong>” and log in with any currently existing virtual user (Most likely the user you added with Postfixadmin earlier). Be sure to use a full email address to log into Maia-Mailguard. IE: <strong>username@domain.tld</strong>. That user will now have admin privs via Maia (So, be careful which user you choose).</p>
<p style="padding-left: 60px;">Now, that you’re logged into Maia-Mailguard as an administrator, click the “<strong>Admin</strong>” link at the top of the page (Key-shaped icon). From the “<strong>Administration Menu</strong>” click “<strong>System Configuration</strong>“. Each mail server will want different settings for their setup. However, there are some things you should be aware of:</p>
<p style="padding-left: 60px;"><strong>1.</strong> Make sure that *<strong>ANY</strong>* file name (With the exception of the logo image) listed for any option is listed with it’s *FULL PATH*.</p>
<p style="padding-left: 60px;"><strong>2.</strong> The “<strong>Mail size limit</strong>” setting should not be higher than what you set your <strong>MySQL’s max_allowed_packet </strong>to (10M in my example) in <strong>/var/db/mysql/my.cnf</strong>. Remember that this setting is in bytes. So, 10*1024*1024 would give you 1048576 (10M).</p>
<p style="padding-left: 30px;"><strong><em>IMPORTANT:</em></strong></p>
<p style="padding-left: 60px;">For each domain you create using Postfixadmin or any other way you may create it, Maia needs to know about it in order to create users. This might seem like a redundant issue, but it really makes a difference and here’s why… When Maia recieves mail for a user that doesn’t exist, it uses the default domain’s (@.) settings. This is fine. However, if it considers that mail to be spam when it is not, the user cannot retrieve that message later being as the default settings don’t house mail for a non-existant user. So, be sure to add any domain you add via PostfixAdmin to Maia-Mailguard as well.</p>
<p style="padding-left: 30px;"><strong><em>Edit /usr/local/etc/postfix/main.cf file:</em></strong></p>
<p style="padding-left: 30px;">Find and edit the <span style="color: #ff0000;">RED TEXT</span>.</p>
<pre style="padding-left: 60px;">…
# Maia-Mailguard
#<span style="color: #ff0000;">
content_filter=smtp-amavis:[127.0.0.1]:10024</span>
# LOCAL PATHNAME INFORMATION
#
# The queue_directory specifies the location of the Postfix queue.
# This is also the root directory of Postfix daemons that run chrooted.
# See the files in examples/chroot-setup for setting up Postfix chroot
# environments on different UNIX systems.
#
queue_directory = /var/spool/postfix
…</pre>
<p style="padding-left: 30px;"><em><strong>Edit /usr/local/etc/postfix/master.cf file:</strong></em></p>
<p style="padding-left: 30px;">Add <span style="color: #ff0000;">RED TEXT</span> to bottom of file.</p>
<pre style="padding-left: 60px;"><span style="color: #ff0000;">smtp-amavis unix - - n - 2 smtp
   -o smtp_data_done_timeout=2400
   -o smtp_send_xforward_command=yes
   -o disable_dns_lookups=yes
   -o max_use=20
127.0.0.1:10025 inet n - n - - smtpd
   -o content_filter=
   -o local_recipient_maps=
   -o relay_recipient_maps=
   -o smtpd_restriction_classes=
   -o smtpd_delay_reject=no
   -o smtpd_client_restrictions=permit_mynetworks,reject
   -o smtpd_helo_restrictions=
   -o smtpd_sender_restrictions=
   -o smtpd_recipient_restrictions=permit_mynetworks,reject
   -o mynetworks_style=host
   -o mynetworks=127.0.0.0/8
   -o strict_rfc821_envelopes=yes
   -o smtpd_error_sleep_time=0
   -o smtpd_soft_error_limit=1001
   -o smtpd_hard_error_limit=1000
   -o smtpd_client_connection_count_limit=0
   -o smtpd_client_connection_rate_limit=0
   -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks,no_address_mappings</span></pre>
<p style="padding-left: 30px;"><strong><em>Reload Postfix:</em></strong></p>
<pre style="padding-left: 60px;">#postfix reload</pre>
<p style="padding-left: 30px;"><strong><em>Edit the “vscan” user’s cron jobs:</em></strong></p>
<pre style="padding-left: 60px;">#crontab -u vscan -e</pre>
<p style="padding-left: 30px;">Copy and paste into user vscan’s crontab.</p>
<pre style="padding-left: 60px;">#Load new rules and store into Maia database.
30 4 * * * /var/amavisd/maia/scripts/load-sa-rules.pl &gt; /dev/null

#Train Spam Assassin.
0 * * * * /var/amavisd/maia/scripts/process-quarantine.pl --learn --report &gt; /dev/null

#Take a snapshot of the stats at the start of every hour.
0 * * * * /var/amavisd/maia/scripts/stats-snapshot.pl &gt; /dev/null

#Purge mail that has not been confirmed.
0 23 * * * /var/amavisd/maia/scripts/expire-quarantine-cache.pl &gt; /dev/null

#Send quarantine reminders.
0 15 * * * /var/amavisd/maia/scripts/send-quarantine-reminders.pl &gt; /dev/null

#Send quarantine digests.
0 15 * * * /var/amavisd/maia/scripts/send-quarantine-digests.pl &gt; /dev/null

#Force bayesian auto-expiry during off-peak hours.
25 2 * * * /usr/local/bin/sa-learn --sync --force-expire &gt; /dev/null</pre>
<p><strong>12 &#8211; SquirrelMail Install</strong></p>
<p style="padding-left: 30px;">SquirrelMail is a very actively developed, fun, and easy to use webmail application. I prefer SquirrelMail mostly because of the broad list of plugins available for it. You can read more about it by visiting <a href="http://www.squirrelmail.org" target="_blank">http://www.squirrelmail.org</a>.</p>
<p style="padding-left: 30px;">This tutorial installs version <strong>1.4.15_1</strong>.</p>
<p style="padding-left: 30px;"><strong><em>Install SquirrelMail via ports:</em></strong></p>
<pre style="padding-left: 60px;">#cd /usr/ports/mail/squirrelmail
#make all install clean</pre>
<p style="padding-left: 30px;"><strong><em>SquirrelMail configuration:</em></strong></p>
<pre style="padding-left: 60px;">#cd /usr/local/www/squirrelmail
#./configure</pre>
<p style="padding-left: 30px;"><strong><em>SquirrelMail Options:</em></strong></p>
<p style="padding-left: 60px;">1. Choose option “<span style="color: #ff0000;">2. Server Settings</span>“.</p>
<p style="padding-left: 60px;">2. Choose option “<span style="color: #ff0000;">1. Domain</span>” and change it to your domain name.</p>
<p style="padding-left: 60px;">3. Choose option “<span style="color: #ff0000;">A. Update IMAP Settings</span>” then option “<span style="color: #ff0000;">5. IMAP Port</span>” and change it to “993“.</p>
<p style="padding-left: 60px;">4. Choose option “<span style="color: #ff0000;">7. Secure IMAP (TLS)</span>” and change it to “<span style="color: #ff0000;">true</span>” by pressing “<span style="color: #ff0000;">y</span>“.</p>
<p style="padding-left: 60px;">5. Choose option “<span style="color: #ff0000;">8. Server software</span>” then type”<span style="color: #ff0000;">dovecot</span>” followed by the “<span style="color: #ff0000;">ENTER</span>” to set it.</p>
<p style="padding-left: 60px;">6. Press “<span style="color: #ff0000;">s</span>” followed by the “<span style="color: #ff0000;">ENTER</span>” key to save.</p>
<p style="padding-left: 60px;">7. Press “<span style="color: #ff0000;">q</span>” followed by the “<span style="color: #ff0000;">ENTER</span>” key to quit.</p>
<p style="padding-left: 30px;"><strong><em>Edit /usr/local/etc/apache22/Includes/squirrelmail.conf file:</em></strong></p>
<pre style="padding-left: 60px;">Alias /squirrelmail/ "/usr/local/www/squirrelmail/"
&lt;Directory "/usr/local/www/squirrelmail"&gt;
   AllowOverride None
   Options None
   Order allow,deny
   Allow from all
&lt;/Directory&gt;</pre>
<p style="padding-left: 30px;"><em><strong>Reload Apache configuration:</strong></em></p>
<pre style="padding-left: 60px;">#apachectl graceful</pre>
<p style="padding-left: 30px;"><strong><em>Test:</em></strong></p>
<p style="padding-left: 60px;">SquirrelMail should now be installed and working. Visit “<strong>https://domain.tld/squirrelmail/src/configtest.php</strong>” to make sure all is well. If there are no errors, great! Click the “<strong>Login now</strong>” link at the bottom and proceed to log in.</p>
<p style="padding-left: 30px;"><strong><em>Note:</em></strong></p>
<p style="padding-left: 60px;">If you are having trouble logging into SquirrelMail even though you know you’re using the correct login information, verify that “<strong>file_uploads</strong>” is set to “<strong>On</strong>” in your <strong>/usr/local/etc/php.ini</strong> file.</p>
<p style="padding-left: 60px;">Once logged in, go a head and send an email to either yourself or someone else and make sure everything is working properly. If you or the third party recieved the email, you’re finished with the SquirrelMail install.</p>
<p style="padding-left: 60px;">After you are sure everything is functioning as it should, continue on and begin installing some plugins for SquirrelMail. These plugins will make your life much easier as an adminitrator…</p>
<p style="padding-left: 30px;"><strong><em>Install Quota Usage plugin via ports:</em></strong></p>
<pre style="padding-left: 60px;">#cd /usr/ports/mail/squirrelmail-quota_usage-plugin
#make all install clean
#cd /usr/local/www/squirrelmail/plugins/check_quota
#cp config.sample.php config.php</pre>
<p style="padding-left: 30px;"><strong><em>Edit /usr/local/www/squirrelmail/plugins/check_quota/config.php file:</em></strong></p>
<p style="padding-left: 30px;">Find and edit the <span style="color: #ff0000;">RED TEXT</span>.</p>
<pre style="padding-left: 60px;">…
$settings['quota_type'] = <span style="color: #ff0000;">1</span>;
…</pre>
<p style="padding-left: 30px;"><strong><em>NOTE:</em></strong></p>
<p style="padding-left: 30px;">If you would like the quota usage to display the amount <strong>AND </strong>percentage used (Like I do…), you can use the patch I made like so:</p>
<pre style="padding-left: 60px;">#cd /usr/local/www/squirrelmail/plugins/check_quota
#fetch http://www.purplehat.org/downloads/postfix_guide/check_quota.diff
#patch -p0&lt;check_quota.diff
#rm -rf check_quota.diff</pre>
<p style="padding-left: 30px;"><strong><em>Install Secure Login plugin via ports:</em></strong></p>
<pre style="padding-left: 60px;">#cd /usr/ports/mail/squirrelmail-secure_login-plugin
#make all install clean
#cd /usr/local/www/squirrelmail/plugins/secure_login/
#cp config.sample.php config.php</pre>
<p style="padding-left: 30px;"><strong><em>Install Timeout plugin via ports:</em></strong></p>
<pre style="padding-left: 60px;">#cd /usr/ports/mail/squirrelmail-timeout_user-plugin
#make all install clean</pre>
<p style="padding-left: 30px;"><strong><em>Activate the plugins:</em></strong></p>
<pre style="padding-left: 60px;">#cd /usr/local/www/squirrelmail
#./configure</pre>
<p style="padding-left: 30px;"><strong><em>SquirrelMail Options:</em></strong></p>
<p style="padding-left: 60px;">1. Choose option “<span style="color: #ff0000;">8. Plugins</span>“.</p>
<p style="padding-left: 60px;">2. To install a plugin, just press its number.</p>
<p style="padding-left: 60px;">3. I recommend installing the following plugins: “<span style="color: #ff0000;">squirrelspell</span>“, “<span style="color: #ff0000;">filters</span>“, “<span style="color: #ff0000;">calendar</span>“, “<span style="color: #ff0000;">compatibility</span>“, “<span style="color: #ff0000;">check_quota</span> “,”<span style="color: #ff0000;">secure_login</span>“, and “<span style="color: #ff0000;">timeout_user</span>“.</p>
<p style="padding-left: 60px;">4. Press “<span style="color: #ff0000;">s</span>” then “<span style="color: #ff0000;">ENTER</span>” to save and “<span style="color: #ff0000;">q</span>” to quit.</p>
<p style="padding-left: 30px;"><strong><em>Note:</em></strong></p>
<p style="padding-left: 60px;">The “<strong>filters</strong>” plugin is used to filter out mail which Maia-Mailguard has modified the subject with “<strong>***SPAM***</strong> “. If you choose to load this plugin, be sure you edit the “<strong>setup.php</strong>” file in the plugin’s directory to turn “$AllowSpamFilters = true;” to “<strong>$AllowSpamFilters = false;</strong>“. Of course, if you are going to use the spam filters, disregard this note.</p>
<p style="padding-left: 60px;">SquirrelMail should now be 100% functional. Be sure to let users know to “<strong>purge</strong>” their “<strong>Trash</strong>” directory on occassion so their quota doesn’t max out. That’s bad.</p>
<p style="padding-left: 60px;">If you would like to automatically purge mail directories in any way, shape or form, check out the SquirrelMail web site and dig through their stuff. They have tons of it…</p>
<p><strong>13 &#8211; MailMan Install</strong></p>
<p style="padding-left: 30px;">Mailman is a very nice and very well supported Mailing List application. So, if you’d like to host mailing lists, this would be my recommended software. You can read more about it by visiting <a href="http://www.gnu.org/software/mailman/index.htm" target="_blank">http://www.gnu.org/software/mailman/index.htm</a>l.</p>
<p style="padding-left: 30px;">This tutorial installs version <strong>2.1.10</strong>.</p>
<p style="padding-left: 30px;"><strong><em>Install Mailman via ports:</em></strong></p>
<pre style="padding-left: 60px;">#cd /usr/ports/mail/mailman
#make all install clean
(Be sure the “<span style="color: #ff0000;">POSTFIX</span>” option is selected from the menu)</pre>
<p style="padding-left: 30px;"><strong><em>Enable mailman to start at boot</em></strong>:</p>
<pre style="padding-left: 60px;">#echo 'mailman_enable="YES"' &gt;&gt; /etc/rc.conf</pre>
<p style="padding-left: 30px;"><em><strong>Get Postfix-To-Mailman script</strong></em></p>
<pre style="padding-left: 60px;">#cd /usr/local/mailman
#fetch http://www.gurulabs.com/downloads/postfix-to-mailman-2.1.py
#mv postfix-to-mailman-2.1.py postfix-to-mailman.py
#chmod 750 postfix-to-mailman.py
#chown mailman:mailman postfix-to-mailman.py</pre>
<p style="padding-left: 30px;"><strong><em>Edit /usr/local/mailman/postfix-to-mailman.py file:</em></strong></p>
<p style="padding-left: 30px;">Find and edit the <span style="color: #ff0000;">RED TEXT</span>.</p>
<pre style="padding-left: 60px;"><span style="color: #ff0000;">#! /usr/local/bin/python</span>
…
# Configuration variables - Change these for your site if necessary.
MailmanHome = “<span style="color: #ff0000;">/usr/local/mailman</span>“; # Mailman home directory.
MailmanOwner = “<span style="color: #ff0000;">postmaster@domain.tld</span>“; # Postmaster and abuse mail recipient.
…</pre>
<p style="padding-left: 30px;"><strong><em>Edit /usr/local/etc/postfix/main.cf file:</em></strong></p>
<p style="padding-left: 30px;">Find and edit the <span style="color: #ff0000;">RED TEXT</span>.</p>
<pre style="padding-left: 60px;">...
relay_domains = proxy:mysql:/usr/local/etc/postfix/mysql_relay_domains_maps.cf <span style="color: #ff0000;">lists.domain.tld</span>
...
# TRANSPORT MAP
#
# See the discussion in the ADDRESS_REWRITING_README document.
transport_maps = hash:/usr/local/etc/postfix/transport
vacation_destination_recipient_limit = 1
<span style="color: #ff0000;">mailman_destination_recipient_limit = 1</span>
...</pre>
<p style="padding-left: 30px;"><strong><em>Add transport for list to /usr/local/etc/postfix/transport file:</em></strong></p>
<pre style="padding-left: 60px;">#echo 'lists.domain.tld mailman:' &gt;&gt; /usr/local/etc/postfix/transport</pre>
<p style="padding-left: 30px;"><strong><em>Edit /usr/local/etc/postfix/master.cf file:</em></strong></p>
<p style="padding-left: 30px;">Add <span style="color: #ff0000;">RED TEXT</span> to end of file.</p>
<pre style="padding-left: 60px;"><span style="color: #ff0000;">mailman unix - n n - - pipe
   flags=FR user=mailman:mailman
   argv=/usr/local/mailman/postfix-to-mailman.py ${nexthop} ${user}</span></pre>
<p style="padding-left: 30px;"><strong><em>Create Postfix transport database:</em></strong></p>
<pre style="padding-left: 60px;">#postmap /usr/local/etc/postfix/transport</pre>
<p style="padding-left: 30px;"><strong><em>Reload Postfix:</em></strong></p>
<pre style="padding-left: 60px;">#postfix reload</pre>
<p style="padding-left: 30px;"><strong><em>Edit /usr/local/etc/apache22/extra/httpd-vhosts.conf file:</em></strong></p>
<p style="padding-left: 30px;">Add <span style="color: #ff0000;">RED TEXT</span> directly under “NameVirtualHost *:80″ line.</p>
<pre style="padding-left: 60px;">NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any  block.
#
<span style="color: #ff0000;"># Default domain on this server
#
&lt;Virtualhost *:80&gt;
   ServerAdmin webmaster@domain.tld
</span><span style="color: #ff0000;">   </span><span style="color: #ff0000;">DocumentRoot "/usr/local/www/apache22/data"
</span><span style="color: #ff0000;">   </span><span style="color: #ff0000;">ServerName www.domain.tld
</span><span style="color: #ff0000;">   </span><span style="color: #ff0000;">ServerAlias domain.tld www.domain.tld
</span><span style="color: #ff0000;">   </span><span style="color: #ff0000;">&lt;Directory "/usr/local/www/apache22/data"&gt;
</span><span style="color: #ff0000;">   </span><span style="color: #ff0000;">   </span><span style="color: #ff0000;">AllowOverride None
</span><span style="color: #ff0000;">   </span><span style="color: #ff0000;">   </span><span style="color: #ff0000;">Options None
</span><span style="color: #ff0000;">   </span><span style="color: #ff0000;">   </span><span style="color: #ff0000;">Order allow,deny
</span><span style="color: #ff0000;">   </span><span style="color: #ff0000;">   </span><span style="color: #ff0000;">Allow from all
</span><span style="color: #ff0000;">   </span><span style="color: #ff0000;">&lt;/Directory&gt;
</span><span style="color: #ff0000;">   </span><span style="color: #ff0000;">ErrorLog /var/log/httpd-error.log
</span><span style="color: #ff0000;">   </span><span style="color: #ff0000;">CustomLog /var/log/httpd-access.log combined
&lt;/Virtualhost&gt;
# Mailman mailing list domain.
#
&lt;Virtualhost *:80&gt;
</span><span style="color: #ff0000;">   </span><span style="color: #ff0000;">ServerAdmin webmaster@domain.tld
</span><span style="color: #ff0000;">   </span><span style="color: #ff0000;">DocumentRoot "/usr/local/mailman"
</span><span style="color: #ff0000;">   </span><span style="color: #ff0000;">ServerName lists.domain.tld
</span><span style="color: #ff0000;">   </span><span style="color: #ff0000;">ServerAlias lists.domain.tld
</span><span style="color: #ff0000;">   </span><span style="color: #ff0000;">ScriptAlias /cgi-bin/ "/usr/local/mailman/cgi-bin/"
</span><span style="color: #ff0000;">   </span><span style="color: #ff0000;">ScriptAlias /mailman/ "/usr/local/mailman/cgi-bin/"
</span><span style="color: #ff0000;">   </span><span style="color: #ff0000;">Alias /pipermail "/usr/local/mailman/archives/public"
</span><span style="color: #ff0000;">   </span><span style="color: #ff0000;">Alias /icons "/usr/local/mailman/icons"
</span><span style="color: #ff0000;"> </span><span style="color: #ff0000;">  </span><span style="color: #ff0000;">&lt;Directory "/usr/local/mailman"&gt;
</span><span style="color: #ff0000;">   </span><span style="color: #ff0000;">   </span><span style="color: #ff0000;">AllowOverride All
</span><span style="color: #ff0000;">   </span><span style="color: #ff0000;">   </span><span style="color: #ff0000;">Options FollowSymlinks
</span><span style="color: #ff0000;">   </span><span style="color: #ff0000;">   </span><span style="color: #ff0000;">Order allow,deny
</span><span style="color: #ff0000;">  </span><span style="color: #ff0000;">   </span><span style="color: #ff0000;"> </span><span style="color: #ff0000;">Allow from all
</span><span style="color: #ff0000;">   </span><span style="color: #ff0000;">&lt;/Directory&gt;
</span><span style="color: #ff0000;">   </span><span style="color: #ff0000;">ErrorLog /var/log/httpd-error.log
</span><span style="color: #ff0000;">   </span><span style="color: #ff0000;">CustomLog /var/log/httpd-access.log combined
&lt;/Virtualhost&gt;</span></pre>
<p style="padding-left: 30px;"><strong><em>NOTE:</em></strong></p>
<p style="padding-left: 60px;">Notice the addition of the default HTTP directory. The reason for this is due to the fact that once virtual hosting is enabled, the default directory used by Apache is the first VirtualHost listed in the httpd-vhosts.conf file. So, make sure that what ever site you plan on using as the default site for that machine comes first in the list of virtual hosts in the httpd-vhosts.conf file.</p>
<p style="padding-left: 60px;">After adding the above VirtualHost directive, you can delete or comment out the remaining lines in the httpd-vhosts.conf file being as they’re just the default examples and pretty much useless.</p>
<p style="padding-left: 30px;"><strong><em>Edit /usr/local/etc/apache22/httpd.conf to include vhosts:</em></strong></p>
<p style="padding-left: 30px;">Find and edit the <span style="color: #ff0000;">RED TEXT</span>.</p>
<pre style="padding-left: 60px;">…
# Virtual hosts
<span style="color: #ff0000;">Include etc/apache22/extra/httpd-vhosts.conf</span>
…</pre>
<p style="padding-left: 30px;"><strong><em>Reload Apache configuration:</em></strong></p>
<pre style="padding-left: 60px;">#apachectl graceful</pre>
<p style="padding-left: 30px;"><strong><em>Test:</em></strong></p>
<p style="padding-left: 60px;">Visit “<strong>http://lists.domain.tld/mailman/listinfo</strong>” and you should see the mailing list information page. If not, restart with the MailMan install. Otherwise, you’ll notice that the ‘Powered by FreeBSD’ logo is missing. “OH NO!”. This, of course, can <strong>NOT </strong>continue… So, let’s go a head and copy our FBSD logo into proper directory…</p>
<p style="padding-left: 30px;"><em><strong>Copy FBSD logo so Mailman sees it:</strong></em></p>
<pre style="padding-left: 60px;">#cd /usr/local/mailman/icons
#cp /usr/local/www/icons/powerlogo.gif ./
Yep! Beastie!</pre>
<p style="padding-left: 30px;"><em><strong>Set site password:</strong></em></p>
<pre style="padding-left: 60px;">#cd /usr/local/mailman
#bin/mmsitepass
New site password: <span style="color: #ff0000;">mailman_password</span>
Again to confirm password: <span style="color: #ff0000;">mailman_password</span></pre>
<p style="padding-left: 30px;"><em><strong>Create Mailman list:</strong></em></p>
<pre style="padding-left: 60px;">#bin/newlist
Enter the name of the list: <span style="color: #ff0000;">mailman</span>
Enter the email of the person running the list: <span style="color: #ff0000;">you@domain.tld</span>
Initial mailman password: <span style="color: #ff0000;">list_password</span></pre>
<p style="padding-left: 60px;">You’ll then see instructions to add aliases for the mailing list. We need not worry about that because everything is virtual. So, proceeding… Hit enter to notify mailman owner… <span style="color: #ff0000;">ENTER</span></p>
<p style="padding-left: 30px;"><em><strong>Add list to Mailman configuration file:</strong></em></p>
<pre style="padding-left: 60px;"># echo "add_virtualhost('<span style="color: #ff0000;">lists.domain.tld</span>','<span style="color: #ff0000;">lists.domain.tld</span>')" &gt;&gt; /usr/local/mailman/Mailman/mm_cfg.py</pre>
<p style="padding-left: 30px;"><em><strong>Start Mailman:</strong></em></p>
<pre style="padding-left: 60px;">#/usr/local/etc/rc.d/mailman start</pre>
<p style="padding-left: 30px;"><em><strong>Test:</strong></em></p>
<p style="padding-left: 60px;">Visit “<strong>http://lists.domain.tld/</strong> again. Once the page loads, click the “<strong>the list admin overview page</strong>” link. Then, click the “<strong>create a new mailing list</strong>” link.<br />
Fill in the blanks:<br />
Name of list: <span style="color: #ff0000;">test</span><br />
Initial list owner address: <span style="color: #ff0000;">you@domain.tld</span><br />
Enter list passwords…<br />
List creator’s (authentication) password: <span style="color: #ff0000;">site_password</span><br />
Click “<strong>Create List</strong>” button.</p>
<p style="padding-left: 30px;"><strong><em>IMPORTANT!</em></strong></p>
<p style="padding-left: 60px;">Something that has been lingering in the back of mind for a long time and was just recently brought to my attention by my buddy Zbigniew (Thanks!) is the fact that Mailman handling virtual mailing lists will accept *ANY* mail addressed to lists.domain.tld (Or any other list you host). This will produce a surreal amount of backscatter if there were ever a dictionary spam attack on your mailing list. So, in order to fix this we must create a separate map of legitimate mailing list addresses for each mailing list you create. Yes, I know this can be a royal pain in the rear, but I haven’t figured out a good automated process for this yet. So, let’s do this now, shall we?</p>
<p style="padding-left: 30px;"><strong><em>Find all available mailing list addresses:</em></strong></p>
<pre style="padding-left: 60px;">#cd /usr/local/mailman
#bin/genaliases</pre>
<p style="padding-left: 30px;"><strong><em>Create and edit /usr/local/etc/postfix/relay_recipients file:</em></strong></p>
<p style="padding-left: 60px;">Add every address Postfix should accept mail for for Mailman along with the domains (Using the output from the previous command). Also, follow each address with an “OK”. In other words, if you had a mailing list called ‘users@lists.domain.tld’, your file would look something like this (by default):</p>
<pre style="padding-left: 60px;">users@lists.domain.tld OK
users-admin@lists.domain.tld OK
users-bounces@lists.domain.tld OK
users-confirm@lists.domain.tld OK
users-join@lists.domain.tld OK
users-leave@lists.domain.tld OK
users-owner@lists.domain.tld OK
users-request@lists.domain.tld OK
users-subscribe@lists.domain.tld OK
users-unsubscribe@lists.domain.tld OK</pre>
<p style="padding-left: 30px;"><strong><em>Create map for Postfix:</em></strong></p>
<pre style="padding-left: 60px;">#postmap /usr/local/etc/postfix/relay_recipients</pre>
<p style="padding-left: 30px;"><strong><em>Note:</em></strong></p>
<p style="padding-left: 60px;">You <strong>MUST </strong>do the above for every mailing list you create in Mailman. Otherwise, Postfix will reject the e-mail. Of course, all addresses can be added to the same file. Also, don’t forget to re-run the ‘postmap’ command and reload Postfix after each edit of the ‘relay_recipients’ file.</p>
<p style="padding-left: 30px;"><strong><em>Edit /usr/local/etc/postfix/main.cf file:</em></strong></p>
<p style="padding-left: 30px;">This will tell Postfix to accept mail for virtual users as well as our mailing list addresses.</p>
<pre style="padding-left: 60px;">...
relay_recipient_maps = proxy:mysql:/usr/local/etc/postfix/mysql_virtual_mailbox_maps.cf, hash:/usr/local/etc/postfix/relay_recipients
...</pre>
<p style="padding-left: 30px;"><strong><em>Reload Postfix’s configuration:</em></strong></p>
<pre style="padding-left: 60px;">#postfix reload</pre>
<p style="padding-left: 30px;"><strong><em>Subscribe to the test mailing list:</em></strong></p>
<p style="padding-left: 60px;">Visit “<strong>http://lists.domain.tld/mailman/listinfo</strong></p>
<p style="padding-left: 60px;">Click the name of the new list you’ve created (You might have to reload/refresh the page if nothing shows up). Fill in the blanks in the section labeled “<strong>Subscribing to listname</strong>” and submit.</p>
<p style="padding-left: 60px;">Check your email and confirm your subscription.</p>
<p style="padding-left: 60px;">Send an email to “<strong>listname@lists.domain.tld</strong>“.</p>
<p style="padding-left: 60px;">If everything goes correctly, the mail should be submitted without a problem. Again, check the <strong>/var/log/maillog</strong> for any errors that may occur.</p>
<p style="padding-left: 60px;">If there are no errors, visit “<strong>http://lists.domain.tld/pipermail/listname</strong>” to view your submitted mails.</p>
<p style="padding-left: 30px;"><strong><em>Note:</em></strong></p>
<p style="padding-left: 60px;">Also, don’t forget to add a “mailman@domain.tld” alias to point to a legit user on your mail server. Otherwise, you’ll see errors in your maillog.</p>
<p style="padding-left: 30px;"><em><strong>Adding more lists to MailMan</strong></em></p>
<p style="padding-left: 30px;"><strong><em>Add a new list to Mailman:</em></strong></p>
<pre style="padding-left: 60px;">#cd /usr/local/mailman
#bin/newlist -u <span style="color: #ff0000;">lists.domain2.tld</span> -e <span style="color: #ff0000;">lists.domain2.tld listname</span></pre>
<p style="padding-left: 30px;"><strong><em>Add new list to Mailman configuration file:</em></strong></p>
<pre style="padding-left: 60px;">#echo "add_virtualhost('<span style="color: #ff0000;">lists.domain2.tld</span>','<span style="color: #ff0000;">lists.domain2.tld</span>')" &gt;&gt; /usr/local/mailman/Mailman/mm_cfg.py</pre>
<p style="padding-left: 30px;"><strong><em>Edit /usr/local/etc/postfix/main.cf file:</em></strong></p>
<p style="padding-left: 30px;">Find and edit the <span style="color: #ff0000;">RED TEXT</span>.</p>
<pre style="padding-left: 60px;">...
relay_domains = proxy:mysql:/usr/local/etc/postfix/mysql_relay_domains_maps.cf lists.domain.tld <span style="color: #ff0000;">lists.domain2.tld</span>
...</pre>
<p style="padding-left: 30px;"><strong><em>Add transport to Postfix:</em></strong></p>
<pre style="padding-left: 60px;">#echo 'lists.domain2.tld mailman:' &gt;&gt; /usr/local/etc/postfix/transport</pre>
<p style="padding-left: 30px;"><strong><em>Rebuild Postfix’s transport database:</em></strong></p>
<pre style="padding-left: 60px;">#postmap /usr/local/etc/postfix/transport</pre>
<p style="padding-left: 30px;"><strong><em>Reload Postfix for changes:</em></strong></p>
<pre style="padding-left: 60px;">#postfix reload</pre>
<p style="padding-left: 30px;"><strong><em>Edit /usr/local/etc/apache22/extra/httpd-vhosts.conf file:</em></strong></p>
<pre style="padding-left: 60px;"><span style="color: #ff0000;">&lt;VirtualHost *:80&gt;
   ServerAdmin webmaster@domain2.tld
   DocumentRoot "/usr/local/mailman"
   ServerName lists.domain2.tld
   ServerAlias lists.domain2.tld
   ScriptAlias /cgi-bin/ "/usr/local/mailman/cgi-bin/"
   ScriptAlias /mailman/ "/usr/local/mailman/cgi-bin/"
   Alias /pipermail "/usr/local/mailman/archives/public"
   Alias /icons "/usr/local/mailman/icons"
   &lt;Directory /usr/local/mailman&gt;
      AllowOverride All
      Options FollowSymlinks
      Order allow,deny
      Allow from all
   &lt;/Directory&gt;
   ErrorLog /var/log/httpd-error.log
   CustomLog /var/log/httpd-access.log combined
&lt;/VirtualHost&gt;</span></pre>
<p style="padding-left: 30px;"><strong><em>Reload Apache configuration:</em></strong></p>
<pre style="padding-left: 60px;">#apachectl graceful</pre>
<p style="padding-left: 60px;">That’s about it. Now, just visit “<strong>http://lists.domain2.tld/mailman/listinfo</strong>“. Edit, subscribe, etc… and you’re all set.</p>
<p><strong>14 &#8211; Mailgraph Install</strong></p>
<p style="padding-left: 30px;">Mailgraph is a nice little statistics CGI script for your mail server. You can read more about it by visiting <a href="http://mailgraph.schweikert.ch" target="_blank">http://mailgraph.schweikert.ch</a>.</p>
<p style="padding-left: 30px;">This tutorial installs version <strong>1.14_2</strong>.</p>
<p style="padding-left: 30px;"><strong><em>Install RRDTool:</em></strong></p>
<pre style="padding-left: 60px;">#cd /usr/ports/databases/rrdtool
#make all install clean (Menu defaults are fine)</pre>
<p style="padding-left: 30px;"><strong><em>Patch and install Mailgraph:</em></strong></p>
<p style="padding-left: 30px;">(Many thanks to DrkShdw for this patch and many other helpful things…)</p>
<pre style="padding-left: 60px;">#cd /usr/ports/mail/mailgraph
#make extract
#fetch http://www.purplehat.org/downloads/postfix_guide/mailgraph-1.14-postfix.diff
#patch -p0 &lt; mailgraph-1.14-postfix.diff
#make all install clean</pre>
<p style="padding-left: 30px;"><strong><em>Add Mailgraph to system startup:</em></strong></p>
<pre style="padding-left: 60px;">#echo 'mailgraph_enable="YES"' &gt;&gt; /etc/rc.conf</pre>
<p style="padding-left: 30px;"><strong><em>Start Mailgraph application:</em></strong></p>
<pre style="padding-left: 60px;">#/usr/local/etc/rc.d/mailgraph start</pre>
<p style="padding-left: 30px;"><strong><em>NOTE:</em></strong></p>
<p style="padding-left: 60px;">If you are using a different Apache layout than this tutorial/guide has set up and you aren’t able to access the mailgraph.cgi script via http://www.domain.tld/cgi-bin/mailgraph.cgi, you can fix this easily by copying the mailgraph.cgi script to your preffered cgi-bin by issuing a command similar to the following:</p>
<pre style="padding-left: 60px;">#cp /usr/local/www/cgi-bin/mailgraph.cgi <span style="color: #ff0000;">/path/to/your/cgi-bin/mailgraph.cgi</span></pre>
<p style="padding-left: 60px;">Changing the /path/to/your/cgi-bin/, of course.</p>
<p style="padding-left: 60px;">You’ll also need to copy the ‘mailgraph’ directory located in /usr/local/www/data to your base directory in order to use the mailgraph CSS information. This is also very simple to do. Just issue something like so:</p>
<pre style="padding-left: 60px;">#cp -Rp /usr/local/www/data/mailgraph/ <span style="color: #ff0000;">/path/to/your/data/mailgraph/</span></pre>
<p style="padding-left: 60px;">Again, changing the /path/to/your/data/.</p>
<p><strong>15 &#8211; Roundcube Install</strong></p>
<p>Roundcube is a great webmail application that has been coming along quite nicely. As I’d mentioned before, I prefer Squirrelmail due to plugins and more support. But, Roundcube looks very nice and beginning to ‘bloom’. So, feel free to play with it. A lot of users will prefer this over SquirrelMail. You can check out more about Roundcube by visiting <a href="http://roundcube.net" target="_blank">http://roundcube.net</a>.</p>
<p>This tutorial installs version <strong>0.1.1_1,1</strong>.</p>
<p><strong><em>Install Roundcube via ports:</em></strong></p>
<pre style="padding-left: 30px;">#cd /usr/ports/mail/roundcube
#make install clean
(Be sure “<span style="color: #ff0000;">MySQL</span>” and “<span style="color: #ff0000;">SPELLCHECK</span>” are selected from the menu.)</pre>
<p><strong><em>Create MySQL database and user for Roundcube:</em></strong></p>
<pre style="padding-left: 30px;">#mysql -u root -p mysql
&gt;CREATE DATABASE roundcube;
&gt;GRANT ALL PRIVILEGES ON roundcube.* TO roundcube@localhost
&gt;IDENTIFIED BY '<span style="color: #ff0000;">roundcube_password</span>';
&gt;quit;</pre>
<p><strong><em>Populate the Roundcube database:</em></strong></p>
<pre style="padding-left: 30px;">#cd /usr/local/www/roundcube/SQL
#mysql -u roundcube -p roundcube &lt; mysql5.initial.sql
(Enter Roundcube’s SQL password)</pre>
<p><strong><em>Edit /usr/local/www/roundcube/config/db.inc.php file:</em></strong></p>
<p>Find and edit the <span style="color: #ff0000;">RED TEXT</span>.</p>
<pre style="padding-left: 30px;">...
$rcmail_config['db_dsnw'] = '<span style="color: #ff0000;">mysql://roundcube:roundcube_sql_password@unix(/tmp/mysql.sock)/roundcube</span>';
...</pre>
<p><strong><em>Edit /usr/local/www/roundcube/config/main.inc.php file:</em></strong></p>
<p>Find and edit the <span style="color: #ff0000;">RED TEXT</span>.</p>
<pre style="padding-left: 30px;">…
 $rcmail_config['default_host'] = ‘<span style="color: #ff0000;">ssl://localhost:993</span>‘;
 …
 $rcmail_config['default_port'] = <span style="color: #ff0000;">993</span>;
 …
 $rcmail_config[â€™useragentâ€™] = â€˜<span style="color: #ff0000;">RoundCube Webmail</span>â€™;
 …</pre>
<p><strong><em>Secure Roundcube configuration files:</em></strong></p>
<pre style="padding-left: 30px;">#chmod 600 /usr/local/www/roundcube/config/*</pre>
<p><strong><em>Edit /usr/local/etc/apache22/Includes/roundcube.conf file:</em></strong></p>
<pre style="padding-left: 30px;">Alias /roundcube "/usr/local/www/roundcube/"
&lt;Directory "/usr/local/www/roundcube"&gt;
   Options Indexes FollowSymLinks
   AllowOverride All
   Order allow,deny
   Allow from all
&lt;/Directory&gt;</pre>
<p><strong><em>Reload Apache’s configuration:</em></strong></p>
<pre style="padding-left: 30px;">#apachectl graceful</pre>
<p><strong><em>Test:</em></strong></p>
<p style="padding-left: 30px;">Visit “<strong>https://www.domain.tld/roundcube/</strong>” and login to roundcube using your full email address and password. You should now be able to use Roundcube as a webmail client. If you’re having any problems, be sure to check your Roundcube logs located in “/usr/local/www/roundcube/logs“.</p>
<p style="text-align: right; "><a href="http://www.purplehat.org/?page_id=4" target="_blank">from PURPLEHAT ORGANIZATION</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tusoffka.org/2009/07/31/freebsd-postfix-mysql-spamassassin-maia-virtual-setup/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How many FreeBSD hackers does it take to change a lightbulb?</title>
		<link>http://blog.tusoffka.org/2009/07/20/how-many-freebsd-hackers-does-it-take-to-change-a-lightbulb/</link>
		<comments>http://blog.tusoffka.org/2009/07/20/how-many-freebsd-hackers-does-it-take-to-change-a-lightbulb/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 20:50:33 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[FreeBSD]]></category>

		<guid isPermaLink="false">http://blog.tusoffka.org/?p=11</guid>
		<description><![CDATA[One thousand, one hundred and seventy-two:
Twenty-three to complain to -current about the lights being out;
Four to claim that it is a configuration problem, and that such matters really belong on -questions;
Three to submit PRs about it, one of which is misfiled under doc and consists only of &#8220;it&#8217;s dark&#8221;;
One to commit an untested lightbulb which [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-thumbnail wp-image-12" title="freebsd-logo" src="http://blog.tusoffka.org/wp-content/uploads/2009/07/freebsd-logo-150x150.png" alt="freebsd-logo" width="150" height="150" />One thousand, one hundred and seventy-two:</p>
<p>Twenty-three to complain to -current about the lights being out;</p>
<p>Four to claim that it is a configuration problem, and that such matters really belong on -questions;<span id="more-11"></span></p>
<p>Three to submit PRs about it, one of which is misfiled under doc and consists only of &#8220;it&#8217;s dark&#8221;;</p>
<p>One to commit an untested lightbulb which breaks buildworld, then back it out five minutes later;</p>
<p>Eight to flame the PR originators for not including patches in their PRs;</p>
<p>Five to complain about buildworld being broken;</p>
<p>Thirty-one to answer that it works for them, and they must have cvsupped at a bad time;</p>
<p>One to post a patch for a new lightbulb to -hackers;</p>
<p>One to complain that he had patches for this three years ago, but when he sent them to -current they were just ignored, and he has had bad experiences with the PR system; besides, the proposed new lightbulb is non-reflexive;</p>
<p>Thirty-seven to scream that lightbulbs do not belong in the base system, that committers have no right to do things like this without consulting the Community, and WHAT IS -CORE DOING ABOUT IT!?</p>
<p>Two hundred to complain about the color of the bicycle shed;</p>
<p>Three to point out that the patch breaks <a href="http://www.freebsd.org/cgi/man.cgi?query=style&amp;sektion=9" target="_blank">style(9)</a>;</p>
<p>Seventeen to complain that the proposed new lightbulb is under GPL;</p>
<p>Five hundred and eighty-six to engage in a flame war about the comparative advantages of the GPL, the BSD license, the MIT license, the NPL, and the personal hygiene of unnamed FSF founders;</p>
<p>Seven to move various portions of the thread to -chat and -advocacy;</p>
<p>One to commit the suggested lightbulb, even though it shines dimmer than the old one;</p>
<p>Two to back it out with a furious flame of a commit message, arguing that FreeBSD is better off in the dark than with a dim lightbulb;</p>
<p>Forty-six to argue vociferously about the backing out of the dim lightbulb and demanding a statement from -core;</p>
<p>Eleven to request a smaller lightbulb so it will fit their Tamagotchi if we ever decide to port FreeBSD to that platform;</p>
<p>Seventy-three to complain about the SNR on -hackers and -chat and unsubscribe in protest;</p>
<p>Thirteen to post &#8220;unsubscribe&#8221;, &#8220;How do I unsubscribe?&#8221;, or &#8220;Please remove me from the list&#8221;, followed by the usual footer;</p>
<p>One to commit a working lightbulb while everybody is too busy flaming everybody else to notice;</p>
<p>Thirty-one to point out that the new lightbulb would shine 0.364% brighter if compiled with TenDRA (although it will have to be reshaped into a cube), and that FreeBSD should therefore switch to TenDRA instead of EGCS;</p>
<p>One to complain that the new lightbulb lacks fairings;</p>
<p>Nine (including the PR originators) to ask &#8220;what is MFC?&#8221;;</p>
<p>Fifty-seven to complain about the lights being out two weeks after the bulb has been changed.</p>
<p><em>Nik Clayton adds:</em></p>
<p>I was laughing quite hard at this.</p>
<p>And then I thought, &#8220;Hang on, shouldn&#8217;t there be &#8216;1 to document it.&#8217; in that list somewhere?&#8221;</p>
<p>And then I was enlightened <img src='http://blog.tusoffka.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p><em>Thomas Abthorpe says:</em> “None, real FreeBSD hackers are not afraid of the dark!”</p>
<p style="text-align: right;"><a href="http://www.freebsd.org/doc/en/books/faq/funnies.html#CHANGING-LIGHTBULBS" target="_blank">from The FreeBSD Funnies</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.tusoffka.org/2009/07/20/how-many-freebsd-hackers-does-it-take-to-change-a-lightbulb/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
