I have installed and configured spammassassin in my system(14.04) using this tutor. When I start a service using,
service spamassassin start
am getting response as,
Starting SpamAssassin Mail Filter Daemon: server socket setup failed, retry 1: spamd: could not create IO::Socket::INET6 socket on [::1]:783: Cannot assign requested address
server socket setup failed, retry 2: spamd: could not create IO::Socket::INET6 socket on [127.0.0.1]:783: Address already in use
server socket setup failed, retry 3: spamd: could not create IO::Socket::INET6 socket on [127.0.0.1]:783: Address already in use
server socket setup failed, retry 4: spamd: could not create IO::Socket::INET6 socket on [127.0.0.1]:783: Address already in use
server socket setup failed, retry 5: spamd: could not create IO::Socket::INET6 socket on [127.0.0.1]:783: Address already in use
server socket setup failed, retry 6: spamd: could not create IO::Socket::INET6 socket on [127.0.0.1]:783: Address already in use
server socket setup failed, retry 7: spamd: could not create IO::Socket::INET6 socket on [127.0.0.1]:783: Address already in use
server socket setup failed, retry 8: spamd: could not create IO::Socket::INET6 socket on [127.0.0.1]:783: Address already in use
server socket setup failed, retry 9: spamd: could not create IO::Socket::INET6 socket on [127.0.0.1]:783: Address already in use
spamd: could not create IO::Socket::INET6 socket on [127.0.0.1]:783: Address already in use
I have tried,
netstat -lptn
it's showing,
there is process running with 127.0.1.1:783
also tried,
sudo netstat -lepnt
am getting,
here too not showing any process run with 127.0.1.1:783
Please tell me where the problem cause ?
Run
sudo netstat -lptn | grep 783
and get the PID (right most side of the output - some thing like 2332/spamd.pid ) of the program that uses 783 port. Then kill that program withsudo kill -9 PID
. Then start the spamassasinservice spamassassin start
If you still get the INET6 socket error, try running spamd without IPv6 support (assuming you don't need it).
Add -4 to your OPTIONS line
Otherwise, troubleshoot your IPv6 config.
Check if ipv6 is enabled
If it isn't enable it or disable ipv6 in spamassassin as suggested above.
I had the same problem. The answers here did not help me at all. I found that the problem went away, without disabling IPv6, by editing
/etc/default/spamassassin
and adding a user forspamd
, as described here. The essential steps described in that page are:1)
sudo apt-get install spamassassin spamc
2)
sudo adduser spamd --disabled-login
3) Edit
/etc/default/spamassassin
to include the following:4) Edit
/etc/spamassassin/local.cf
to set up some anti-spam rules, e.g.,5)
sudo service spamassassin start
One more step is described, to update
postfix
, which was not needed in my case. I think the core of the issue is step 2 and then adding--username spamd
in theOPTIONS
of/etc/default/spamassassin
Update: how to start the spamassassin service with Ubuntu 20.10
Install
spamassassin
(and alsospamc
andsa-compile
):Spamassassin can be run in the foreground with
spamassassin
and in the background as a daemon withspamd -d
.The installation creates a non login user
debian-spamd
.Why a dedicated user?
Do not create user
spamd
!Make a startup item:
Check the configuration:
My best guess for configuration file
/etc/default/spamassassin
is:See
man spamd
for all options.Start service without restarting the computer:
or
Restart service after configuration change without restarting the computer:
Check status:
Check running options:
where
debian-+
is a shorthand fordebian-spamd
(too long forps
).Check PID:
Check that
spamd
is listening on the network:Given default port number 783,
sudo netstat -nlp|grep 783
will return the same information independently of the PID.spamd can be used with a mail server but it can also be used directly in the command line. After
spamc
, type some text, exit withControl-D
, this yields a report.The same report can be obtained with
spamassassin
.spamd
itself can be launched in the command line.In
/etc/default/spamassassin
, ENABLE, PIDFILE, CRON have no effect. With CRON = 1, I see no cron job:Other configuration file:
/etc/init.d/spamassassin
.Do not confuse the spamassassin service configuration (discussed so far) with the spamassassin configuration (how to detect spam). The latter is explained in
man spamassassin
, in particular the configuration file names.