=over 4
-=item collectd_socket [ socket path ] (default: /tmp/.collectd-email)
+=item collectd_socket [ socket path ] (default: /var/run/collectd-email)
Where the collectd socket is
config.
=cut
+
+=item collectd_timeout [ sec ] (default: 2)
+
+if sending data to to collectd takes too long the connection will be aborted.
+
+=cut
+
+=item collectd_retries [ tries ] (default: 3)
+
+the collectd plugin uses a tread pool, if this is empty the connection fails,
+the SA Plugin then tries to reconnect. With this variable you can indicate how
+often it should try.
+
+=cut
+
=head1 DESCRIPTION
This modules uses the email plugin of collectd from Sebastian Harl to
push (@cmds, {
setting => 'collectd_socket',
- default => '/tmp/.collectd-email',
+ default => '/var/run/collectd-email',
type => $Mail::SpamAssassin::Conf::CONF_TYPE_STRING,
});
#try at least $self->{main}->{conf}->{collectd_retries} to get a
#connection
for (my $i = 0; $i < $self->{main}->{conf}->{collectd_retries} ; ++$i) {
- last if $sock = new IO::Socket::UNIX
- ($self->{main}->{conf}->{collectd_socket});
+ my ($socket_path) = $self->{main}->{conf}->{collectd_socket} =~ /(.*)/; # Untaint path, which can contain any characters.
+ last if $sock = new IO::Socket::UNIX $socket_path;
#sleep a random value between 0 and 50 microsecs to try for a new
#thread
usleep(int(rand(50)));