{"id":321,"date":"2012-10-02T00:31:43","date_gmt":"2012-10-02T07:31:43","guid":{"rendered":"http:\/\/eriknovales.com\/blog\/?p=321"},"modified":"2012-10-02T00:31:43","modified_gmt":"2012-10-02T07:31:43","slug":"quick-guide-for-installing-spamassassin-as-a-service","status":"publish","type":"post","link":"https:\/\/eriknovales.com\/?p=321","title":{"rendered":"Quick guide for installing SpamAssassin as a service"},"content":{"rendered":"<p>I was having some issues with spam on my mail server (<a href=\"http:\/\/hmailserver.com\/\">hMailServer<\/a>), so I decided to set up <a href=\"http:\/\/spamassassin.apache.org\/\">SpamAssassin<\/a> to filter things before they hit my inbox. While hMailServer has some native support for SpamAssassin, I figured I would write up the steps I used to get things running smoothly as a Windows service.<\/p>\n<p>Note that this is on a Windows Server 2003 box \u2013 steps may vary for other versions.<\/p>\n<ul>\n<li>Download and install the <a href=\"http:\/\/www.jam-software.com\/spamassassin\/\">Win32 binaries for SpamAssassin from JAM Software<\/a>. This includes the <strong>spamd<\/strong> daemon, but this normally runs as a command-line application. It is better to run it as a Windows service, so it can be launched automatically when the machine reboots, without having to log in and run it manually.<\/li>\n<li>Install the <a href=\"http:\/\/www.microsoft.com\/en-us\/download\/details.aspx?id=17657\">Windows Server 2003 Resource Kit Tools<\/a>, if you haven\u2019t done so already. This contains the <strong>srvany<\/strong> tool, which can be used to run an application as a service.<\/li>\n<li>Open a command prompt for the Resource Kit Tools. There\u2019s a shortcut installed with the tools.<\/li>\n<li>Run <strong>instsrv SpamAssassin &lt;path to Resource Kit Tools&gt;\\srvany.exe<\/strong>. This will install a new \u201cSpamAssassin\u201d service, linked to the <strong>srvany<\/strong> tool.<\/li>\n<li>Now, open up the registry editor (<strong>regedit<\/strong>). Create a new key under <strong>HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Services\\SpamAssassin<\/strong>, called <strong>Parameters<\/strong>.<\/li>\n<li>Under the <strong>Parameters<\/strong> key, create a string value called <strong>Application<\/strong>. Set the value of this to <strong>&lt;SpamAssassin path&gt;\\spamd.exe<\/strong>.<\/li>\n<li>Under the <strong>Parameters<\/strong> key, create another string value called <strong>AppDirectory<\/strong>. Set the value of this to <strong>&lt;SpamAssassin path&gt;<\/strong>.<\/li>\n<li>Go to the Services administrator tool, and start the new <strong>SpamAssassin<\/strong> service you created.<\/li>\n<li>Now, open up the hMailServer administrator tool, and go to <strong>Settings\\Anti-spam<\/strong>. Click on the <strong>SpamAssassin<\/strong> tab, and check the <strong>Use SpamAssassin<\/strong> checkbox. Fill in the appropriate hostname (localhost should be fine, although you can use 127.0.0.1 if that doesn\u2019t work), and check the <strong>Use score from SpamAssassin<\/strong> box. Finally, click on the <strong>Test\u2026<\/strong> button to test your configuration. If a dialog box shows up with a response from the SpamAssassin service, you\u2019re good to go.<\/li>\n<li>If not, check to make sure that the service is running, and that the port used (783, by default) is not blocked. Check to see if the port is being used, by running <strong>netstat \u2013an<\/strong> and checking to see that something (the <strong>spamd<\/strong> daemon) is using TCP port 783. You can also try enabling logging with <strong>spamd<\/strong> by creating an <strong>AppParameters<\/strong> string value under the registry key mentioned above, and setting it to \u2013<strong>s file<\/strong>. This should result in a <em>spamd.log<\/em> file being created in the same directory as <strong>spamd.exe<\/strong>, and the information within might help you debug the issue.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>I was having some issues with spam on my mail server (hMailServer), so I decided to set up SpamAssassin to filter things before they hit my inbox. While hMailServer has some native support for SpamAssassin, I figured I would write up the steps I used to get things running smoothly as a Windows service. Note [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[6],"tags":[],"class_list":["post-321","post","type-post","status-publish","format-standard","hentry","category-computing"],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/eriknovales.com\/index.php?rest_route=\/wp\/v2\/posts\/321","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/eriknovales.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/eriknovales.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/eriknovales.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/eriknovales.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=321"}],"version-history":[{"count":0,"href":"https:\/\/eriknovales.com\/index.php?rest_route=\/wp\/v2\/posts\/321\/revisions"}],"wp:attachment":[{"href":"https:\/\/eriknovales.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=321"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/eriknovales.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=321"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/eriknovales.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=321"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}