Package: spampd
Version: 2.30-23
Severity: important

If spampd receives a SIGHUP it resets its options to the application's defaults
ie. the options set in the script, not the options set in the service file or
by the commandline flags.

The easiest way to demonstrate this is to start it as normal:

# service spampd start

Send SIGHUP to its pid:

# kill -HUP `cat /var/run/spampd/spampd.pid`

And then look in the mail.log for what has happened:

spampd[3075]: 2016/12/29-00:24:04 Couldn't open pid file "/var/run/spampd.pid"
[Permission denied].#012#012  at line 179 in file
/usr/share/perl5/Net/Server.pm
Dec 29 00:24:04 debian spampd[3075]: 2016/12/29-00:24:04 Server closing!

It has tried to open the pid file in its default location of
"/var/run/spampd.pid" instead of the location configured in the service file:

PIDFile=/var/run/spampd/spampd.pid

Although that location was used initially, it forgot it after the SIGHUP.

The same thing happens if you start it from the commandline:

# spampd --pid=/var/run/spampd/spampd.pid

If you play with the permissions so that it can write the default pid file when
HUP'd so it keeps running, other options reset as well such as the relay
host/port options default to locahost:25 instead of localhost:10026 which in my
setup creates an infinite mail loop (smtp server gives the mail to spampd which
passes it back on port 25 so the smtp server gives it back to spampd and so
on).

I suspect what is happening is spampd calls GetOptions() which I think removes
the commandline flags from @ARGS, and the documentation for the Net::Server
module which spampd uses says not to alter the contents of @ARGS until ->run is
called, so because of GetOptions(), when ->run is called @ARGS is empty so when
Net::Server handles the HUP it reloads with no parameters set.



-- System Information:
Debian Release: 8.5
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_NZ.UTF-8, LC_CTYPE=en_NZ.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages spampd depends on:
ii  adduser              3.113+nmu3
ii  dpkg                 1.17.27
ii  init-system-helpers  1.22
ii  libnet-server-perl   2.008-1
ii  lsb-base             4.1+Debian13+nmu1
pn  perl:any             <none>
ii  spamassassin         3.4.0-6

spampd recommends no packages.

spampd suggests no packages.

-- Configuration Files:
/etc/spampd.conf [Errno 13] Permission denied: u'/etc/spampd.conf'

-- no debconf information

Reply via email to