spamd - daemonized version of spamassassin
spamd [options]
Options:
-c, --create-prefs Create user preferences files -C path, --configpath=path Path for default config files --siteconfigpath=path Path for site configs -d, --daemonize Daemonize -h, --help Print usage message. -i [ipaddr], --listen-ip=ipaddr Listen on the IP ipaddr -p port, --port Listen on specified port -m num, --max-children=num Allow maximum num children --max-conn-per-child=num Maximum connections accepted by child before it is respawned -q, --sql-config Enable SQL config (only useful with -x) -Q, --setuid-with-sql Enable SQL config (only useful with -x, enables use of -H) --ldap-config Enable LDAP config (only useful with -x) --setuid-with-ldap Enable LDAP config (only useful with -x, enables use of -a and -H) --virtual-config-dir=dir Enable pattern based Virtual configs (needs -x) -r pidfile, --pidfile Write the process id to pidfile -s facility, --syslog=facility Specify the syslog facility --syslog-socket=type How to connect to syslogd -u username, --username=username Run as username -v, --vpopmail Enable vpopmail config -x, --nouser-config Disable user config files --auth-ident Use ident to authenticate spamc user --ident-timeout=timeout Timeout for ident connections -A host,..., --allowed-ips=..,.. Limit ip addresses which can connect -D, --debug Print debugging messages -L, --local Use local tests only (no DNS) -P, --paranoid Die upon user errors -H [dir], --helper-home-dir[=dir] Specify a different HOME directory --ssl Run an SSL server --server-key keyfile Specify an SSL keyfile --server-cert certfile Specify an SSL certificate --socketpath=path Listen on given UNIX domain socket --socketowner=name Set UNIX domain socket file's owner --socketgroup=name Set UNIX domain socket file's group --socketmode=mode Set UNIX domain socket file's mode
The purpose of this program is to provide a daemonized version of the spamassassin executable. The goal is improving throughput performance for automated mail checking.
This is intended to be used alongside spamc
, a fast, low-overhead C client
program.
See the README file in the spamd
directory of the SpamAssassin distribution
for more details.
Note: Although spamd
will check per-user config files for every message, any
changes to the system-wide config files will require either restarting spamd
or forcing it to reload itself via SIGHUP for the changes to take effect.
Note: If spamd
receives a SIGHUP, it internally reloads itself, which means
that it will change its pid and might not restart at all if its environment
changed (ie. if it can't change back into its own directory). If you plan
to use SIGHUP, you should always start spamd
with the -r switch to know its
current pid.
Options of the long form can be shortened as long as they remain unambiguous. (i.e. --dae can be used instead of --daemonize) Also, boolean options (like --user-config) can be negated by adding no (--nouser-config), however, this is usually unnecessary.
/usr/share/spamassassin
or similar).
/etc/mail/spamassassin
or similar).
Note: If spamd is set to run as a non-root user (-u), and is to run on a privileged port (any < 1024), the parent will not be able to be sent a SIGHUP to reload the configuration.
If your spamc client does not support sending the User:
header,
like exiscan
, then the SQL username used will always be nobody.
--sql-config
,
only it is using an LDAP server.
--setuid-with-sql
, only it is using an LDAP server.
@
sign.@
sign.So for example, if /vhome/users/%u/spamassassin
is specified, and spamc
sends a virtual username of jm@example.com
, the directory
/vhome/users/jm@example.com/spamassassin
will be used.
The set of characters allowed in the virtual username for this path are restricted to:
A-Z a-z 0-9 - + _ . , @ =
All others will be replaced by underscores (_
).
This path must be a writable directory. It will be created if it does not
already exist. If a file called user_prefs exists in this directory (note:
not in a .spamassassin
subdirectory!), it will be loaded as the user's
preferences. The auto-whitelist and/or Bayes databases for that user will be
stored in this directory.
Note that this requires that -x is used, and cannot be combined with SQL- or LDAP-based configuration.
The pattern must expand to an absolute directory when spamd is running daemonized (-d).
Currently, use of this without -u is not supported.
stderr
is specified,
output will be written to stderr. (This is useful if you're running spamd
under the daemontools
package.) With a facility of file
, all output
goes to spamd.log. facility is interpreted as a file name to log to if it
contains any characters except a-z and 0-9. null
disables logging completely
(used internally).
Examples: | |
spamd -s mail # use syslog, facility mail (default) | |
spamd -s ./mail # log to file ./mail | |
spamd -s stderr 2>/dev/null # log to stderr, throw messages away | |
spamd -s null # the same as above | |
spamd -s file # log to file ./spamd.log | |
spamd -s /var/log/spamd.log # log to file /var/log/spamd.log |
If logging to a file is enabled and that log file is rotated, the spamd server must be restarted with a SIGHUP. (If the log file is just truncated, this is not needed but still recommended.)
unix
,
inet
or none
. The default is to try unix
first, falling back to
inet
if perl detects errors in its unix
support.
Some platforms, or versions of perl, are shipped with dysfunctional versions of the Sys::Syslog package which do not support some socket types, so you may need to set this. If you get error messages regarding __PATH_LOG or similar from spamd, try changing this setting.
The socket type file
is used internally and should not be specified.
setuid()
to the user running spamc
, if spamd
is running
as root.
Note: ``--username=root'' is not a valid option. If specified, spamd
will
exit with a fatal error on startup.
Note: If this option is set to a non-root user, and spamd is to run on a privileged port (any < 1024, default 783 or via -p), the parent will not be able to be sent a SIGHUP to reload the configuration.
off(on)
reading of per-user configuration files (user_prefs) from the
user's home directory. The default behaviour is to read per-user
configuration from the user's home directory.
This option does not disable or otherwise influence the SQL, LDAP or Virtual Config Dir settings.
-A 10.11.12.13 -- only allow connections from 10.11.12.13
.
-A 10.11.12.13,10.11.12.14 -- only allow connections from 10.11.12.13
and
10.11.12.14
.
-A 10.200.300.0/24 -- allow connections from any machine in the range
10.200.300.*
.
-A 10. -- allow connections from any machine in the range 10.*.*.*
.
By default, connections are only accepted from localhost [127.0.0.1].
-L
flag to spamassassin(1)
.
Incoming connections can still occur if all of the children are busy,
however those connections will be queued waiting for a free child.
The minimum value is 1
, the default value is 5
.
Please note that there is a OS specific maximum of connections that can be
queued (Try perl -MSocket -e'print SOMAXCONN'
to find this maximum).
1
, the default value is 200
.
root
, and if -u
is used, that user should have write permissions to unlink the file
later, for when the spamd
server is killed.
--socketowner
for notes on ownership and permissions.
-u
is
used, that user should have write permissions to unlink the file later, for
when the spamd
server is killed.
spamc(1)
spamassassin(1)
Mail::SpamAssassin::Conf(3)
Mail::SpamAssassin(3)
Mail::SpamAssassin
The SpamAssassin(tm)
Project (http://spamassassin.apache.org/)
SpamAssassin is distributed under the Apache License, Version 2.0, as
described in the file LICENSE
included with the distribution.