(Hide Sidebars) SpamPal for Windows

Quick Links
 
International Mirrors
 
Non-English
 
Search
 

SpamPal - Windows Service support

The SpamPal v1.62 beta-release can be run as a Windows service. This document aims to briefly summarise how SpamPal operates as a Windows service, and how you can make best use of new features.

What is a Windows Service?

Previously, SpamPal has always run as an application. Most programs you run on your computer will be applications. An application is a program that's intended to be used by one user at a time. If a second user logs in and needs to use an application, a second instance of the application must be executed - in this case your computer is effectively running two separate application programs, which happen to be identical.

A Windows Service is one program that can be shared by all the users of your computer. If a second user needs to use a service you're using, he can share the same instance of that service.

The disadvantage of services is that they aren't strictly supposed to interact with the user. Therefore, each user runs a special GUI client application - the GUI client communicates with the service, and offers GUI functionality to the user.

Why would I want to run SpamPal as a Windows service?

The most common reason would be if you have multiple users of your machine and you use the "Switch User" feature of Windows to switch between them. Running as an application, SpamPal doesn't function well under these conditions - when the second user logs in, it starts up a second instance of SpamPal. But because the first user is also running his own instance of SpamPal, some of the ports SpamPal would use are already in use and you see error messages.

But if you run SpamPal as a service, there will be one copy of SpamPal running as a service, and both users can access it. No fuss and no error messages!

(As an aside, note that both users will also run separate instances of the SpamPal GUI client application, which puts a pink umbrella in the system tray and provides the SpamPal user-interface to the two users.)

There are other situations in which you might want to run SpamPal as a service, but in most of those cases you'll already know about it. :)

What are the disadvantages of running SpamPal as a Windows service?

The main disadvantage is that all users of the SpamPal service share the same configuration settings (including whitelist, blacklist, plugin settings, etc), whereas if you're running Spampal as an application every user has their own settings.

At the time of writing (3rd July 2004), the Bayesian plugin doesn't work well when SpamPal is running as a service. There are also problems with the Address Book Whitelister plugin. All the other plugins should work okay though.

How can I run SpamPal as a service?

Firstly you'll need to be running Windows NT, 2000 or XP. Then you'll need administrator rights to your machine.

Provided you have both of these, when you install SpamPal you should be prompted whether you want to run Spampal as an application or a service. But if you change your mind, there should be some useful shortcuts within the "SpamPal" group in the programs menu.

When you first decide to run SpamPal as a service, choose the "Install SpamPal Service" option from the programs menu. After this the SpamPal service will automatically start up every time your computer restarts. (But you should keep the SpamPal shortcut in the Startup folder, as this will start the GUI client for you.) If you get bored of running SpamPal as a service, choose the "Uninstall SpamPal Service" option. This doesn't uninstall the SpamPal program - it merely stops the service and allows you to run SpamPal as an application again.

There are also shortcuts for starting & stopping the service manually - these will only work if you have already installed the service, however. There's also a program "SpamPalMonitor" which you can use to start & stop the service, and launch the GUI client, and suchlike.

When SpamPal is running as a service, it is not possible to run it as an application at the same time - selecting SpamPal from the Programs menu will launch the SpamPal GUI Client.

Service-related command-line arguments

There's some new command-line arguments available for you to use with the SpamPal executable, that allow you to control the SpamPal service in various ways:

-start_service will start the SpamPal service, provided it has been installed and is not currently running.

-stop_service will stop a currently-running SpamPal service.

-remove_service removes SpamPal from the list of services to run on your machine - it does the same as the "Uninstall SpamPal Service" shortcut in the Programs menu.

-install_service adds SpamPal to the list of services to run on your machine, and prompts the user to start the service and the GUI client.

-account_name <name> and -account_password <pass> can be used at the same time as -install_service to specify the username under which the service should run - if unspecified, it will run under the LocalSystem username. If the username you choose doesn't have a password, just don't include the -account_password directive.

-start_client, if specified at the same time as -start_service, will cause the SpamPal GUI client to start up along with the service.

-start_or_install_service does the same as -start_service if the SpamPal service has already been installed, or the same as -install_service otherwise.

-run_spampal_from_installer causes the SpamPal service & GUI client to start up if it's installed and configured to auto-start. Or if the user doesn't have administration rights, or is running Windows 95, 98 or ME, the SpamPal application will start up. If neither of those cases is true, the user will be prompted whether to run SpamPal as an application or as a service.

-serviceServer <hostname> allows you to specify to the GUI client the name of the machine on which the SpamPal service is running. (This uses named pipes, so it'll probably only work between two machines on your local network.) If you do this, I strongly advise you to use the password protection feature too!

-password <pass> allows specification of a password when the GUI client starts up; see below.

Password Protection

You can password-protect your service to prevent users without the password from connecting to it with a SpamPal GUI client; you could do this, for example, to allow only administrators to modify SpamPal's configuration.

When you start SpamPal as a client or a service, it looks for a password in the following places (listed in order of decreasing priority):

  1. The -password command-line argument
  2. The registry key HKEY_CURRENT_USER\Software\SpamPal for Windows\SpamPal\Password
  3. The registry key HKEY_LOCAL_MACHINE\Software\SpamPal for Windows\SpamPal\Password

If the SpamPal GUI client doesn't find the same password as the SpamPal Service, the client won't be allowed to start up. (Note that the service only searches for the password when it starts up - so if you change the password, you'll need to restart the service before the change will take effect.)

 
Current Versions
 
Latest News
 
Recent Discussions