<?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"
	>

<channel>
	<title>synapse unsync</title>
	<atom:link href="http://blogwords.neologix.net/neils/feed/" rel="self" type="application/rss+xml" />
	<link>http://blogwords.neologix.net/neils</link>
	<description>disconnected thoughts and random brain dumps</description>
	<pubDate>Wed, 22 Oct 2008 09:40:22 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Force Synchronous Network Startup for MS WinXP</title>
		<link>http://blogwords.neologix.net/neils/2008/10/22/force-synchronous-network-startup-for-ms-winxp/</link>
		<comments>http://blogwords.neologix.net/neils/2008/10/22/force-synchronous-network-startup-for-ms-winxp/#comments</comments>
		<pubDate>Wed, 22 Oct 2008 09:37:58 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[IT Stuff]]></category>

		<category><![CDATA[Windows]]></category>

		<category><![CDATA[fast network startup]]></category>

		<category><![CDATA[microsoft]]></category>

		<category><![CDATA[ms win xp]]></category>

		<category><![CDATA[network]]></category>

		<category><![CDATA[network startup]]></category>

		<category><![CDATA[registry]]></category>

		<category><![CDATA[startup]]></category>

		<category><![CDATA[SyncForegroundPolicy]]></category>

		<category><![CDATA[xp]]></category>

		<guid isPermaLink="false">http://blogwords.neologix.net/neils/?p=17</guid>
		<description><![CDATA[One problem I&#8217;ve been having recently with MS WinXP workstations connecting and authenticating to a Samba PDC is that the workstation cannot authenticate to the PDC and download the roaming profile (it uses the local cached copy of the profile instead). The problem seems to be occurring quite frequently with a new generation of &#8220;power [...]]]></description>
			<content:encoded><![CDATA[<p>One problem I&#8217;ve been having recently with MS WinXP workstations connecting and authenticating to a Samba PDC is that the workstation cannot authenticate to the PDC and download the roaming profile (it uses the local cached copy of the profile instead). The problem seems to be occurring quite frequently with a new generation of &#8220;power efficient&#8221; workstations from several different brand name manufacturers although I did have experience of this with some workstations a couple of years ago.</p>
<p>What seems to happen is that the network does not startup before the Ctrl+Alt+Del and login dialog appears. If the workstation is left for about 5-10 minutes the problem usually goes away. Occasionally though the problem becomes so persistent that no matter how often you reboot and regardless of how long you wait the PDC remains uncontactable. The problem is intermittent and inconsistent, for some workstations it will always happen, for others it only appears sporadically.</p>
<p>How to get around it? I&#8217;ve found that forcing windows to start its networking synchronously during the initial workstation startup seems to fix the problem. Making this happen requires a change to registry settings so save the following with a filename of &lt;somefile&gt;.reg &#8230;</p>
<blockquote><p><code>Windows Registry Editor Version 5.00</code></p>
<p><code>[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows NT\CurrentVersion\Winlogon]<br />
&#8220;SyncForegroundPolicy&#8221;=dword:00000001</code></p>
<p><code>[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\Winlogon]<br />
&#8220;SyncForegroundPolicy&#8221;=dword:00000001</code></p></blockquote>
<p>According the docs  at Microsoft&#8217;s Technet site setting this value to dword 1 causes the operating system to &#8220;Always wait for the network at computer startup and logon.&#8221; Why two different registry settings? Microsoft&#8217;s docs say that the first entry in the Policies section of the registry is all that is needed but when inspecting a workstation registry one day I found this actual attribute (with a setting of dword 0) in the second branch of the registry &#8230; &#8220;so to be sure, to be sure&#8221; I&#8217;ve added it in both locations.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogwords.neologix.net/neils/2008/10/22/force-synchronous-network-startup-for-ms-winxp/feed/</wfw:commentRss>
		</item>
		<item>
		<title>A new slant on generating electricity from wind power</title>
		<link>http://blogwords.neologix.net/neils/2008/10/22/a-new-slant-on-generating-electricity-from-wind-power/</link>
		<comments>http://blogwords.neologix.net/neils/2008/10/22/a-new-slant-on-generating-electricity-from-wind-power/#comments</comments>
		<pubDate>Wed, 22 Oct 2008 09:05:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Renewable Energy]]></category>

		<category><![CDATA[electricity]]></category>

		<category><![CDATA[electricity generation]]></category>

		<category><![CDATA[wind]]></category>

		<category><![CDATA[wind electicity generation]]></category>

		<category><![CDATA[wind power]]></category>

		<category><![CDATA[windbelts]]></category>

		<guid isPermaLink="false">http://blogwords.neologix.net/neils/?p=16</guid>
		<description><![CDATA[I&#8217;ve been looking at options for more compact (read unobtrusive) setups for generating electricity from wind power and came across this interesting article on Windbelts. They also include some documentation as well as details on how to build an experimental version of a Windbelt :=)
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been looking at options for more compact (read unobtrusive) setups for generating electricity from wind power and came across this interesting article on <a title="Windbelts" href="http://www.humdingerwind.com" target="_blank">Windbelts</a>. They also include some documentation as well as details on how to build an experimental version of a Windbelt :=)</p>
]]></content:encoded>
			<wfw:commentRss>http://blogwords.neologix.net/neils/2008/10/22/a-new-slant-on-generating-electricity-from-wind-power/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Cloning VMWare ESX VM By Hand</title>
		<link>http://blogwords.neologix.net/neils/2008/10/22/cloning-vmware-vm-by-hand/</link>
		<comments>http://blogwords.neologix.net/neils/2008/10/22/cloning-vmware-vm-by-hand/#comments</comments>
		<pubDate>Wed, 22 Oct 2008 08:51:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[IT Stuff]]></category>

		<category><![CDATA[VMWare]]></category>

		<category><![CDATA[Virtualisation]]></category>

		<category><![CDATA[clone vm]]></category>

		<category><![CDATA[clone vmware vm]]></category>

		<category><![CDATA[cloning]]></category>

		<category><![CDATA[esx]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[virtual machine]]></category>

		<category><![CDATA[vmdk]]></category>

		<category><![CDATA[vmfs]]></category>

		<category><![CDATA[vms]]></category>

		<category><![CDATA[vmxf]]></category>

		<guid isPermaLink="false">http://blogwords.neologix.net/neils/?p=15</guid>
		<description><![CDATA[I know, you&#8217;re asking why would anyone want to do this? Well the answer is that the version I have to work with (VMWare ESX 3.0.2 Starter Edition) does not include support for cloning VMs!!!
Firstly you need to read the excellent notes posted by Mario at http://www.mariospina.com/braindump/ on cloning VMWare ESX 3.0.1 by hand. In [...]]]></description>
			<content:encoded><![CDATA[<p>I know, you&#8217;re asking why would anyone want to do this? Well the answer is that the version I have to work with (VMWare ESX 3.0.2 Starter Edition) does not include support for cloning VMs!!!</p>
<p>Firstly you need to read the excellent notes posted by Mario at <a href="http://www.mariospina.com/braindump/archives/2007/10/06/cloning_vm_by_hand_on_vmware_esx_server_v301.php" target="_blank">http://www.mariospina.com/braindump/</a> on cloning VMWare ESX 3.0.1 by hand. In addition to the steps that Mario lists in his notes, I found that:</p>
<ol>
<li>I could not rename the *flat.vmdk as there was some binary reference to it.</li>
<li>You must recreate the ethernet connection otherwise you will have multiple VMs with duplicate mac addresses (obviously you also need to change the ip address of the VM as well).</li>
<li>I had to change the vm machine id VMId in the .vmxf file so that it was unique amongst all the VMs. I guess this could eventually come back to bite me if/when VMWare creates a VM with the same VMId!!</li>
</ol>
<p>I should also add that these instructions seem to work OK on VMWare ESX 3.0.2.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogwords.neologix.net/neils/2008/10/22/cloning-vmware-vm-by-hand/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Postgres Triggers and Trigger Functions</title>
		<link>http://blogwords.neologix.net/neils/2008/10/21/postgres-triggers-and-trigger-functions/</link>
		<comments>http://blogwords.neologix.net/neils/2008/10/21/postgres-triggers-and-trigger-functions/#comments</comments>
		<pubDate>Tue, 21 Oct 2008 11:10:14 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Databases]]></category>

		<category><![CDATA[IT Stuff]]></category>

		<category><![CDATA[Photography]]></category>

		<category><![CDATA[Renewable Energy]]></category>

		<category><![CDATA[Solaris]]></category>

		<category><![CDATA[snmp]]></category>

		<category><![CDATA[Database]]></category>

		<category><![CDATA[Database Triggers]]></category>

		<category><![CDATA[Postgres]]></category>

		<category><![CDATA[SQL]]></category>

		<category><![CDATA[Trigger]]></category>

		<category><![CDATA[Trigger Functions]]></category>

		<guid isPermaLink="false">http://blogwords.neologix.net/neils/?p=14</guid>
		<description><![CDATA[Postgres triggers are created in 2 stages, firstly you create the trigger function then you link the function to the trigger event. In this sample code a function that fires during before an INSERT event updates a column in the table where the data is being inserted. The function uses an internal (SQL92 compliant) string [...]]]></description>
			<content:encoded><![CDATA[<p>Postgres triggers are created in 2 stages, firstly you create the trigger function then you link the function to the trigger event. In this sample code a function that fires during before an INSERT event updates a column in the table where the data is being inserted. The function uses an internal (SQL92 compliant) string manipulation function to create the additional data that is required to complete the insert. The column has been defined as char (8), the data being manipulated is a postgres date type and must be cast to a text type. Note also that text types are indexed starting at a base of 1 (not 0 as with &#8216;C&#8217; character arrays).</p>
<blockquote><p><code>CREATE OR REPLACE FUNCTION set_initial_pass() RETURNS trigger AS $set_initial_pass$</code><br />
<code>DECLARE</code><br />
<code>yyyy char(4);</code><br />
<code>mm   char(2);</code><br />
<code>dd   char(2);</code><br />
<code>BEGIN</code><br />
<code>yyyy := substring(cast(NEW.dob as text) from 1 for 4);</code><br />
<code>mm   := substring(cast(NEW.dob as text) from  6 for 2);</code><br />
<code>dd   := substring(cast(NEW.dob as text) from 9 for 2);</code><br />
<code>NEW.initial_code := dd||mm||yyyy;</code></p>
<p><code>RETURN NEW;</code><br />
<code>END;</code><br />
<code>$set_initial_pass$</code><br />
<code>LANGUAGE 'plpgsql' VOLATILE COST 100;</code><br />
<code>ALTER FUNCTION set_initial_pass() OWNER TO script;</code></p></blockquote>
<p>Now create the trigger and attach the function above.</p>
<blockquote><p><code><br />
CREATE TRIGGER set_initial_pass<br />
BEFORE INSERT<br />
ON person<br />
FOR EACH ROW<br />
EXECUTE PROCEDURE set_initial_pass();<br />
</code></p></blockquote>
<p>This example was created using pgadmin III.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogwords.neologix.net/neils/2008/10/21/postgres-triggers-and-trigger-functions/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Apply Sun Packages Manually</title>
		<link>http://blogwords.neologix.net/neils/2008/06/08/apply-sun-packages-manually/</link>
		<comments>http://blogwords.neologix.net/neils/2008/06/08/apply-sun-packages-manually/#comments</comments>
		<pubDate>Sun, 08 Jun 2008 00:14:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[IT Stuff]]></category>

		<category><![CDATA[Solaris]]></category>

		<category><![CDATA[package]]></category>

		<category><![CDATA[patch]]></category>

		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://blogwords.neologix.net/neils/?p=13</guid>
		<description><![CDATA[To apply Sun packages manually use the pkgadd command
pkgadd -d full-path-to-package package-name
eg. pkgadd -d /cdrom/Sol10/pkg SUNWlucfg
]]></description>
			<content:encoded><![CDATA[<p>To apply Sun packages manually use the pkgadd command</p>
<blockquote><p><code>pkgadd -d full-path-to-package package-name</code></p></blockquote>
<blockquote><p>eg. <code>pkgadd -d /cdrom/Sol10/pkg SUNWlucfg</code></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blogwords.neologix.net/neils/2008/06/08/apply-sun-packages-manually/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Applying Signed Patches (.jar) to Solaris</title>
		<link>http://blogwords.neologix.net/neils/2008/06/08/applying-signed-patches-jar-to-solaris/</link>
		<comments>http://blogwords.neologix.net/neils/2008/06/08/applying-signed-patches-jar-to-solaris/#comments</comments>
		<pubDate>Sat, 07 Jun 2008 23:21:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[IT Stuff]]></category>

		<category><![CDATA[Solaris]]></category>

		<category><![CDATA[patch]]></category>

		<category><![CDATA[patching]]></category>

		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://blogwords.neologix.net/neils/?p=12</guid>
		<description><![CDATA[The Sun Update Manger usually downloads patches to &#8260;var&#8260;sadm&#8260;spool as .jar files but cannot always apply the patches from the GUI. In this case you may need to open a terminal window and use:

patchadd [-n] [-B full-path-to-backout-directory -M full-path-patch-directory patch-file-name
where:
-n &#8230; do not check the patch signing
-B &#8230; backout directory. This can be omitted if [...]]]></description>
			<content:encoded><![CDATA[<p>The Sun Update Manger usually downloads patches to &frasl;var&frasl;sadm&frasl;spool as .jar files but cannot always apply the patches from the GUI. In this case you may need to open a terminal window and use:</p>
<blockquote><p>
<code>patchadd [-n] [-B full-path-to-backout-directory -M full-path-patch-directory patch-file-name</code><br />
where:<br />
-n &#8230; do not check the patch signing<br />
-B &#8230; backout directory. This can be omitted if you don&#8217;t ever want to back out of a patch!!<br />
-M &#8230; path to location of patch. &frasl;var&frasl;sadm&frasl;spool is the default location so can be omitted if that is where the patch file is located.</p>
<p>eg.  <code>patchadd -n -B &frasl;var&frasl;sadm&frasl;backout -M &frasl;var&frasl;sadm&frasl;spool 128307-04.jar</code>
</p></blockquote>
<p>&#8220;man patchadd&#8221; is your friend.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogwords.neologix.net/neils/2008/06/08/applying-signed-patches-jar-to-solaris/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Using snmp to monitor Cisco ASA</title>
		<link>http://blogwords.neologix.net/neils/2008/05/08/using-snmp-to-monitor-cisco-asa/</link>
		<comments>http://blogwords.neologix.net/neils/2008/05/08/using-snmp-to-monitor-cisco-asa/#comments</comments>
		<pubDate>Thu, 08 May 2008 04:22:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[IT Stuff]]></category>

		<category><![CDATA[snmp]]></category>

		<category><![CDATA[asa]]></category>

		<category><![CDATA[cisco]]></category>

		<category><![CDATA[pix]]></category>

		<category><![CDATA[snmp traps]]></category>

		<guid isPermaLink="false">http://blogwords.neologix.net/neils/?p=11</guid>
		<description><![CDATA[snmp - the Simple Network Management Protocol is anything but as I discovered while trying to monitor status on remote devices. The story so far &#8230;
Some background on snmpwalk
snmpwalk is a very useful tool to explore what snmp information is available from an snmp enabled device. To use snmpwalk, on a commandline enter:
snmpwalk -Os -v [...]]]></description>
			<content:encoded><![CDATA[<p>snmp - the Simple Network Management Protocol is anything but as I discovered while trying to monitor status on remote devices. The story so far &#8230;</p>
<p><strong>Some background on snmpwalk</strong></p>
<p>snmpwalk is a very useful tool to explore what snmp information is available from an snmp enabled device. To use snmpwalk, on a commandline enter:</p>
<blockquote><p><code>snmpwalk -Os -v [1|2c|3] -c community host [ OID ]</code></p>
<p>-Os means print only last symbolic element of OID<br />
-v is the snmp version identifier<br />
-c is the snmp community<br />
host is the ipaddress of the snmp agent you want to query<br />
OID is an optional item which identifies a specific branch of the mib for the device. If given only the values under that branch will be printed.</p></blockquote>
<p>You can use <code>snmpwalk --help</code> to get a full list of options for snmpwalk.<br />
By default an snmp agent listens on UDP port 161 and traps are handled through UDP port 162. If the agent you want to query is not listening on UDP port 161 then you may need to specifiy the agent ip-address and port in the format <code>host:port-number</code>.</p>
<p><strong>Turning snmp on in a Cisco ASA</strong></p>
<blockquote><p><code>#<br />
# allow host #.#.#.# to poll through the ASA's outside interface for snmp<br />
# community "public" using snmp version 2. Refers to the contents of the<br />
# standard MIB-II which is sometimes referred to as RFC1213-MIB<br />
snmp-server host outside #.#.#.# poll community public version 2c<br />
#<br />
# as far as I can see this is informational<br />
snmp-server location MyServerRoom<br />
#<br />
# sets the text for mib object sysContact<br />
snmp-server contact Me<br />
#<br />
# set the snmp community<br />
snmp-server community public<br />
#<br />
# enables the specified snmp traps<br />
snmp-server enable traps snmp authentication linkup linkdown coldstart<br />
</code></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blogwords.neologix.net/neils/2008/05/08/using-snmp-to-monitor-cisco-asa/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Backup renewable energy???</title>
		<link>http://blogwords.neologix.net/neils/2008/05/07/backup-renewable-energy/</link>
		<comments>http://blogwords.neologix.net/neils/2008/05/07/backup-renewable-energy/#comments</comments>
		<pubDate>Wed, 07 May 2008 06:42:02 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Renewable Energy]]></category>

		<category><![CDATA[backup system]]></category>

		<category><![CDATA[renewable energy]]></category>

		<category><![CDATA[solar energy]]></category>

		<category><![CDATA[wind energy]]></category>

		<guid isPermaLink="false">http://blogwords.neologix.net/neils/?p=10</guid>
		<description><![CDATA[I&#8217;ve been looking for a renewable energy system that ties in with the normal power grid for our office and this grid tie system at xantrex looks very interesting. Also look at Solar Online  Australia for some local resources.
More when I can take this idea further &#8230;
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been looking for a renewable energy system that ties in with the normal power grid for our office and this grid tie system at <a href="http://www.xantrex.com/web/id/25/learn.asp" target="_blank">xantrex</a> looks very interesting. Also look at <a href="http://www.solaronline.com.au/index.html" target="_blank">Solar Online  Australia</a> for some local resources.</p>
<p>More when I can take this idea further &#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blogwords.neologix.net/neils/2008/05/07/backup-renewable-energy/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Exim+spamassassin+clamd</title>
		<link>http://blogwords.neologix.net/neils/2008/05/07/eximspamassassinclamd/</link>
		<comments>http://blogwords.neologix.net/neils/2008/05/07/eximspamassassinclamd/#comments</comments>
		<pubDate>Wed, 07 May 2008 06:23:44 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[IT Stuff]]></category>

		<category><![CDATA[exim]]></category>

		<category><![CDATA[anti-virus]]></category>

		<category><![CDATA[clamav]]></category>

		<category><![CDATA[clamd]]></category>

		<category><![CDATA[smtp]]></category>

		<category><![CDATA[spam]]></category>

		<category><![CDATA[spamassassin]]></category>

		<guid isPermaLink="false">http://blogwords.neologix.net/neils/?p=9</guid>
		<description><![CDATA[This will add spam and av scanning to Exim4 configuration at smtp time - note it does not use Exiscan. It will also add a ***SPAM*** marker to the subject line of mails whose spam score is between our minimum spam threshold and the upper spam threshold above which spam mail will be automatically rejected. [...]]]></description>
			<content:encoded><![CDATA[<p>This will add spam and av scanning to Exim4 configuration at smtp time - note it does not use Exiscan. It will also add a ***SPAM*** marker to the subject line of mails whose spam score is between our minimum spam threshold and the upper spam threshold above which spam mail will be automatically rejected. Exim will also check DNSBLs for known spam sources. This configuration has been tested with Exim 4.63. These steps also assume that your have spamassassin and clamav installed, configured and working. If your settings for these very from my examples below you will need to adjust things as required. Now on to the configuration &#8230;</p>
<p>In the Main configuration section of exim.conf</p>
<ul>
<li>add the av scanner. This assumes you have installed clamav, the path to the socket in clamd’s configuration must match the path you specify here:<br />
<blockquote><p><code>av_scanner = clamd:/var/run/clamd.exim/clamd.sock</code></p></blockquote>
</li>
<li>add spamd, by default spamd listens on port 783. If your spamd is using a different socket then change this as appropriate:<br />
<blockquote><p><code>spamd_address = 127.0.0.1 783</code></p></blockquote>
</li>
<li> add in a system filter. We will use the system filter to rewrite the subject line on mails which are identified as spam. If you put the system filter in a different location or name the file differently adjust this entry as needed:<br />
<blockquote><p><code>system_filter = /etc/exim/system.filter</code></p></blockquote>
<p>For our purposes a system filter can be quite simple, all it does it to rewrite the subject line of spam emails &#8230;</p>
<blockquote><p><code>if $header_X-Spam-Flag: contains "YES"<br />
then<br />
headers remove subject<br />
headers add "Subject: $h_X-Spam-Subject:"<br />
endif<br />
</code></p></blockquote>
</li>
</ul>
<p>In the “begin acl” section of your exim.conf file find the “acl_check_rcpt:” acl. There are several sections in this acl which are processed in order. There should be a section that looks like:</p>
<blockquote><p><code>accept hosts    =+relay_from_hosts<br />
= submission<br />
</code></p></blockquote>
<ul>
<li>add the DNSBL processing:<br />
<blockquote><p><code>deny message = DNSBL listed at $dnslist_domain\n$dnslist_text<br />
dnslists = zen.spamhaus.org:bl.spamcop.net:cbl.abuseat.org:psbl.surriel.com</code></p></blockquote>
</li>
</ul>
<p>Now find the acl_check_data: acl</p>
<ul>
<li>near the top add the virus scanner check:<br />
<blockquote><p><code>deny malware 	= *<br />
message	= This message contains a virus ($malware_name).</code></p></blockquote>
</li>
<li>next we start our spam handling - if the email is too large just let it in, the spamassassin processing for large emails is very demanding, also typical spam emails are not large. In this case we will allow messages larger than 100000 bytes through as they are relatively unlikely to be spam<br />
<blockquote><p><code>accept condition	=  ${if &gt;= {$message_size}{100000} {1}}<br />
add_header	= X-Spam-Note: Spamassassin run bypassed due to message size</code></p></blockquote>
</li>
<li>next we allow spamassassin to fail or time out<br />
<blockquote><p><code>warn 	spam		= nobody/defer_ok<br />
add_header	= X-Spam-Flag: YES</code></p></blockquote>
</li>
<li>now add an X-Spam-Report header for messages &lt;80k in size<br />
<blockquote><p><code>warn condition	= ${if &lt;{$message_size}{80k}{1}{0}}<br />
message	= X-Spam-Report: $spam_report<br />
spam		= nobody:true</code></p></blockquote>
</li>
<li>add a note if spamassassin invocation fails<br />
<blockquote><p><code>accept condition	= ${if !def:spam_score_int {1}}<br />
add_header	= X-Spam-Note: Spamassassin invocation failed</code></p></blockquote>
</li>
<li> add the X-Spam headers if the spam score is above the minimum<br />
<blockquote><p><code> warn condition = ${if &gt;{$spam_score_int}{45}{1}}<br />
add_header = X-Spam-Subject: ***SPAM*** $h_subject<br />
add_header = X-Spam-Bar: $spam_bar<br />
add_header = X-Spam-Flag: YES<br />
add_header = X-Spam-Report: $spam_report<br />
</code></p></blockquote>
</li>
<li>reject all mail with a spamscore above your &#8220;reject because it&#8217;s total rubbish, I never want to read it&#8221; maximum spam score<br />
<blockquote><p><code> deny    condition = ${if &gt;{$spam_score_int}{110} {1}}<br />
message   = Your message scored $spam_score SpamAssassin point. Report follows:\n\<br />
$spam_report<br />
</code></p></blockquote>
</li>
<li>the last line in this acl should be to accept any mail which has passed our anti-virus and spam testing so<br />
<blockquote><p><code>accept</code></p></blockquote>
</li>
</ul>
<p>&#8230; and that is it. The DNSBLs I use I&#8217;ve found to be reliable and have an almost 0% rejection of non-spam emails but your mileage might vary so experiment to find the ones which suit you the best (it could be worth checking out the article &#8220;Which ones work well&#8221; at <a href="http://www.dnsbl.com" target="_blank">www.dnsbl.com</a> as a starting point). To check how things are running you can tail the exim log file (<code>tail -f /var/log/exim/main.log</code>)</p>
]]></content:encoded>
			<wfw:commentRss>http://blogwords.neologix.net/neils/2008/05/07/eximspamassassinclamd/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Installing clamav</title>
		<link>http://blogwords.neologix.net/neils/2008/05/06/installing-clamav/</link>
		<comments>http://blogwords.neologix.net/neils/2008/05/06/installing-clamav/#comments</comments>
		<pubDate>Tue, 06 May 2008 11:34:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
		
		<category><![CDATA[Centos 5.x]]></category>

		<category><![CDATA[exim]]></category>

		<category><![CDATA[centos]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[systems administration]]></category>

		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://blogwords.neologix.net/neils/?p=8</guid>
		<description><![CDATA[I wanted to install an anti-virus scanner to work with my smtp server (exim) and since I couldn&#8217;t find a centos repository that included clamav and didn&#8217;t want to spend hours searching I just downloaded the source and installed from scratch. To do this you will need to have a compiler and development libraries installed. [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to install an anti-virus scanner to work with my smtp server (exim) and since I couldn&#8217;t find a centos repository that included clamav and didn&#8217;t want to spend hours searching I just downloaded the source and installed from scratch. To do this you will need to have a compiler and development libraries installed. The steps I followed were:</p>
<ul>
<li>Create the clamav user and group<br />
<blockquote><p><code>sudo groupadd clamav<br />
sudo useradd -g clamav -c "clamav user" -d /var/clamav -s /sbin/nologin -m clamav</code></p></blockquote>
</li>
<li>Download the source from http://www.clamav.net into a working directory and unpack (eg. <code>tar zxvf  clamav-0.93.tar.gz</code>) which will create a source code directory called clamav-0.93 under your working directory.</li>
<li>cd into the source code directory and execute <code>./configure</code> in my case I didn&#8217;t want to change any of the defaults and wanted to install clamav into /usr/local which is the default location. The output will tell you if there are any missing prerequisites such as zlib. If there are any missing prerequisites then I recommend that you install them first and then start to build and install clamav.</li>
<li>Execute <code>make</code> which will compile the clamav source with the configuration options from above.</li>
<li>Install clamav<br />
<blockquote><p><code>sudo make install</code></p></blockquote>
</li>
<li>Edit the clamd.conf file in /usr/local/etc and set appropriate values for the various configuration items. My clamd.conf has the following settings:<br />
<blockquote><p><code>LogFile /tmp/clamd.log<br />
LogFileUnlock yes<br />
LogFileMaxSize 2M<br />
LogTime yes<br />
LogClean yes<br />
LogSyslog yes<br />
PidFile /var/run/clamd.pid<br />
LocalSocket /var/run/clamd.exim/clamd.sock<br />
FixStaleSocket yes<br />
MaxRecursion 128<br />
MaxFileSize 15M<br />
MaxFiles 1500</code></p></blockquote>
<p>for all other settings I accepted the defaults.</li>
<li>Configure /usr/local/etc/fresclam.conf - the settings I changed in my freshclam.conf were:<br />
<blockquote><p><code>UpdateLogFile /var/log/freshclam.log<br />
LogTime yes<br />
LogSyslog yes<br />
PidFile /var/run/freshclam.pid<br />
DatabaseMirror database.clamav.net<br />
NotifyClamd /usr/local/etc/clamd.conf</code></p></blockquote>
<p>all other settings were at their default values</li>
<li>Run freshclam once manually to seed the virus signatures in the database. Execute <code>/usr/local/bin/freshclam</code></li>
<li>For normal operations I also set freshclam to run once per hour by adding it to my crontab<br />
<blockquote><p><code>8 0-23 * * * /usr/local/bin/freshclam 2&gt;&amp;1</code></p></blockquote>
</li>
<li>Create a script to automatically start clamd on a system reboot in /etc/init.d. My /etc/init.d/clamd script is:<br />
<blockquote><p><code><br />
#! /bin/sh<br />
#<br />
### BEGIN INIT INFO<br />
# Provides:          clamd<br />
# Required-Start:    $syslog $network clamd<br />
# X-UnitedLinux-Should-Start:<br />
# Required-Stop:     $syslog $network clamd<br />
# X-UnitedLinux-Should-Stop:<br />
# Default-Start:     3 5<br />
# Default-Stop:      0 1 2 6<br />
# Short-Description: anti virus scan mails<br />
# Description:       Start clamd<br />
### END INIT INFO<br />
# </p>
<p># Check for missing binaries (stale symlinks should not happen)<br />
# Note: Special treatment of stop for LSB conformance<br />
CLAMD_BIN=/usr/local/sbin/clamd<br />
CLAMD_CONFIG=/usr/local/etc/clamd.conf<br />
CLAMD_PID_FILE=/var/run/clamd.pid</p>
<p>test -x $CLAMD_BIN || { echo "$CLAMD_BIN not installed";<br />
if [ "$1" = "stop" ]; then exit 0;<br />
else exit 5; fi; }</p>
<p># Check for existence of needed config file and read it<br />
test -r $CLAMD_CONFIG || { echo &#8220;$CLAMD_CONFIG not existing&#8221;;<br />
if [ "$1" = "stop" ]; then exit 0;<br />
else exit 6; fi; }</p>
<p># Shell functions sourced from /etc/rc.status:<br />
#      rc_check         check and set local and overall rc status<br />
#      rc_status        check and set local and overall rc status<br />
#      rc_status -v     be verbose in local rc status and clear it afterwards<br />
#      rc_status -v -r  ditto and clear both the local and overall rc status<br />
#      rc_status -s     display &#8220;skipped&#8221; and exit with status 3<br />
#      rc_status -u     display &#8220;unused&#8221; and exit with status 3<br />
#      rc_failed        set local and overall rc status to failed<br />
#      rc_failed   set local and overall rc status to<br />
#      rc_reset         clear both the local and overall rc status<br />
#      rc_exit          exit appropriate to overall rc status<br />
#      rc_active        checks whether a service is activated by symlinks<br />
#      rc_splash arg    sets the boot splash screen to arg (if active)<br />
. /etc/rc.status</p>
<p># Reset status of this service<br />
rc_reset</p>
<p># Return values acc. to LSB for all commands but status:<br />
# 0	  - success<br />
# 1       - generic or unspecified error<br />
# 2       - invalid or excess argument(s)<br />
# 3       - unimplemented feature (e.g. &#8220;reload&#8221;)<br />
# 4       - user had insufficient privileges<br />
# 5       - program is not installed<br />
# 6       - program is not configured<br />
# 7       - program is not running<br />
# 8&#8211;199  - reserved (8&#8211;99 LSB, 100&#8211;149 distrib, 150&#8211;199 appl)<br />
#<br />
# Note that starting an already running service, stopping<br />
# or restarting a not-running service as well as the restart<br />
# with force-reload (in case signaling is not supported) are<br />
# considered a success.</p>
<p>case &#8220;$1&#8243; in<br />
start)<br />
echo -n &#8220;Starting clamd&#8221;<br />
$CLAMD_BIN 2&gt;&amp;1</p>
<p># Remember status and be verbose<br />
rc_status -v<br />
;;<br />
stop)<br />
echo -n &#8220;Shutting down clamd&#8221;<br />
CLAMD_PID=`/usr/bin/head -n 1 ${CLAMD_PID_FILE}`<br />
kill -TERM ${CLAMD_PID}</p>
<p># Remember status and be verbose<br />
rc_status -v<br />
;;<br />
restart)<br />
## Stop the service and regardless of whether it was<br />
## running or not, start it again.<br />
$0 stop<br />
$0 start</p>
<p># Remember status and be quiet<br />
rc_status -v<br />
;;<br />
reload)<br />
echo -n &#8220;Reload service clamd&#8221;<br />
$CLAMD_PID=`head -n 1 ${CLAMD_PID_FILEi}`<br />
kill -HUP ${CLAMD_PID}<br />
rc_status -v</p>
<p>## Otherwise:<br />
#$0 stop  &amp;&amp;  $0 start<br />
#rc_status<br />
;;<br />
*)<br />
echo &#8220;Usage: $0 {start|stop|restart|reload}&#8221;<br />
exit 1<br />
;;<br />
esac<br />
rc_exit<br />
</code></p></blockquote>
</li>
<li>Now make a link from the /etc/init.d/clamd script to the runlevel startup directories. Try<br />
<blockquote><p><code>chkconfig clamd on</code></p></blockquote>
<p>or possibly</p>
<blockquote><p><code>ln -s /etc/init.d/clamd /etc/rc3.d/S99clamd<br />
ln -s /etc/init.d/clamd /etc/rc5.d/S99clamd</code></p></blockquote>
</li>
<li>Now start clamd<br />
<blockquote><p><code>/etc/init.d/clamd start</code></p></blockquote>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blogwords.neologix.net/neils/2008/05/06/installing-clamav/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
