Alexander Wirt | 2 Dec 2006 16:11
Picon
Gravatar

First alpha version of SA Plugin

Hi folks,

today I had a little bit time to create a first version the the SA plugin
that feeds Sebastians email collectd plugin. This is considered as an early
alpha as I didn't had the time to test it on a live system, but it shouldn't
break anything. It has been tested under Debian Sid with SA 3.1.7. If you are
brave you can give it a try :), expect some deeper testing of me this
weekend. Installation of the plugin is very simple: Just copy the .pm into
your SA Plugin path (e.g. /usr/share/perl5/Mail/SpamAssassin/Plugin/) and add
a loadplugin call into your init.pre file. See the internal documentation
(pod2text Collectd.pm) for all available options.

If you want to give it a try use svn to checkout the code:
svn co http://ned.snow-crash.org:8080/svn/spamassassin-collectd/trunk

Please give any feedback via mail to me, or use this list I'm subscribed.

Alex

Florian Forster | 2 Dec 2006 19:26
Favicon

Re: First alpha version of SA Plugin

Hi Alex,

On Sat, Dec 02, 2006 at 04:11:09PM +0100, Alexander Wirt wrote:
> today I had a little bit time to create a first version the the SA
> plugin that feeds Sebastians email collectd plugin.

thanks for writing this :) Too bad I don't have SpamAssassin myself :/
But this would almost be worth setting it up ;)

I'll copy the file(s) into the repository within Sebastians email
branch. It'd be awesome if you could send a short message whenever
you've changed anything and so I can pull it again, thanks :)

I've changed my `dns' plugin to use threads, instead of two processes
and a pipe. Since now both plugins check for the pthread-stuff I've
merged Sebastian's email branch and my dns branch and pushed them as
`next' to the repository. It's by no means done yet, but maybe someone
wants to take a look or have a try..

Regards,
-octo
--

-- 
Florian octo Forster
Hacker in training
GnuPG: 0x91523C3D
http://verplant.org/
Alexander Wirt | 2 Dec 2006 19:41
Picon
Gravatar

Re: First alpha version of SA Plugin

Florian Forster schrieb am Samstag, den 02. Dezember 2006:

Hi Florian, 

> thanks for writing this :) Too bad I don't have SpamAssassin myself :/
> But this would almost be worth setting it up ;)
No problem, collectd was on my todo list for a long time, so this was
really a good reason to test it. 

> I'll copy the file(s) into the repository within Sebastians email
> branch. It'd be awesome if you could send a short message whenever
> you've changed anything and so I can pull it again, thanks :)
Wow you are fast, since its considered alpha I indeed expect some
(small) changes in the future, if its time to update your tree I will 
send you a git patchset.

Thanks 
formorer

Alexander Wirt | 2 Dec 2006 21:43
Picon
Gravatar

Re: First alpha version of SA Plugin

Alexander Wirt schrieb am Samstag, den 02. Dezember 2006:

> Hi folks,
> 
> today I had a little bit time to create a first version the the SA plugin
> that feeds Sebastians email collectd plugin. This is considered as an early
> alpha as I didn't had the time to test it on a live system, but it shouldn't
> break anything. It has been tested under Debian Sid with SA 3.1.7. If you are
> brave you can give it a try :), expect some deeper testing of me this
> weekend. Installation of the plugin is very simple: Just copy the .pm into
> your SA Plugin path (e.g. /usr/share/perl5/Mail/SpamAssassin/Plugin/) and add
> a loadplugin call into your init.pre file. See the internal documentation
> (pod2text Collectd.pm) for all available options.
> 
> If you want to give it a try use svn to checkout the code:
> svn co http://ned.snow-crash.org:8080/svn/spamassassin-collectd/trunk
Ok, I have it now productive and it seems to work fine, but I have some
feature requests for the collectd plugin:

- the gid, or the permissions or both have to be configurable. I had to
  recompile the plugin to get it fit into my mailsystem.                                                                                          
- I have some mailsystems which tend to receive 7000 mail/minute, for this                                                                        
  systems the maximum of 5 connections to the socket could be a little bit
  too small ;), this has to be configurable too.

But otherwise it seems to work fine :).

ned:/var/lib/collectd/email# ls
email-ham.rrd                  spam_check-BODY_ENHANCEMENT2.rrd    spam_check-HTML_SHORT_LINK_IMG_2.rrd      spam_check-RCVD_IN_BL_SPAMCOP_NET.rrd
email-spam.rrd                 spam_check-EXTRA_MPART_TYPE.rrd     spam_check-MIME_BOUND_NEXTPART.rrd        spam_check-RCVD_IN_NJABL_DUL.rrd
(Continue reading)

Florian Forster | 3 Dec 2006 10:44
Favicon

email plugin: Make it possible to build the plugin write-only.

From: Florian Forster <octo@...>

So far the plugin simply imported `pthread.h'. If this headerfile (or the
library for that case) was not present, building the plugin would fail. This
patch makes `libpthread' a soft dependency, i. e. it's only necessary if you
want to read from the socket. Without `libpthread' being available the plugin
can still be used in server processes.

Signed-off-by: Florian Forster <octo@...>
---
 src/Makefile.am |    5 ++++-
 src/email.c     |   51 +++++++++++++++++++++++++++++++++++++--------------
 2 files changed, 41 insertions(+), 15 deletions(-)

diff --git a/src/Makefile.am b/src/Makefile.am
index 9e9b466..fcbcb16 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
 <at>  <at>  -173,7 +173,10  <at>  <at>  endif
 if BUILD_MODULE_EMAIL
 pkglib_LTLIBRARIES += email.la
 email_la_SOURCES = email.c
-email_la_LDFLAGS = -module -avoid-version -lpthread
+email_la_LDFLAGS = -module -avoid-version
+if BUILD_WITH_LIBPTHREAD
+email_la_LDFLAGS += -lpthread
+endif
 collectd_LDADD += "-dlopen" email.la
 collectd_DEPENDENCIES += email.la
 endif
(Continue reading)

Sebastian Harl | 3 Dec 2006 11:36
Gravatar

Re: First alpha version of SA Plugin

Hi,

On Sat, Dec 02, 2006 at 09:43:50PM +0100, Alexander Wirt wrote:
> - the gid, or the permissions or both have to be configurable. I had to
>   recompile the plugin to get it fit into my mailsystem.
> - I have some mailsystems which tend to receive 7000 mail/minute, for this
>   systems the maximum of 5 connections to the socket could be a little bit
>   too small ;), this has to be configurable too.

Thanks for the feedback - I will write those changes tonight.

> But otherwise it seems to work fine :).

Great :-)

Cheers,
Sebastian

--

-- 
Sebastian "tokkee" Harl
GnuPG-ID: 0x8501C7FC
http://tokkee.org/

Sebastian Harl | 3 Dec 2006 14:11
Gravatar

[PATCH] email plugin: Made socket settings configurable.

Added config file support to the email plugin.

The following options are available:
* "SocketGroup <group name>"
  Set the group the UNIX socket belongs to to <group name>.
* "SocketPerms <perms>"
  Set the permissions of the UNIX socket to <perms>. No validation is done.
  The user has to make sure reasonable values are given.
* "MaxConns <conns>"
  The maximum number of concurrent connections is set to <conns>.

<perms> and <conns> may be given as decimal (no prefix), octal (prefix "0") or
sedecimal (a.k.a. hexadecimal, prefix "0x") values.

Signed-off-by: Sebastian Harl <sh@...>
---
 src/email.c |   51 ++++++++++++++++++++++++++++++++++++++++++++++++---
 1 files changed, 48 insertions(+), 3 deletions(-)

diff --git a/src/email.c b/src/email.c
index 8d2c891..6838ead 100644
--- a/src/email.c
+++ b/src/email.c
 <at>  <at>  -38,6 +38,8  <at>  <at>  #include "collectd.h"
 #include "common.h"
 #include "plugin.h"

+#include "configfile.h"
+
 #if HAVE_LIBPTHREAD
(Continue reading)

Sebastian Harl | 3 Dec 2006 14:24
Gravatar

Re: email plugin: Make it possible to build the plugin write-only.

Hi Florian,

On Sun, Dec 03, 2006 at 10:44:57AM +0100, Florian Forster wrote:
> So far the plugin simply imported `pthread.h'. If this headerfile (or the
> library for that case) was not present, building the plugin would fail. This
> patch makes `libpthread' a soft dependency, i. e. it's only necessary if you
> want to read from the socket. Without `libpthread' being available the plugin
> can still be used in server processes.

Thanks for the patch. I included it into the next branch in my repository.
Upcoming patches (including the config file support for the email plugin
already sent to this list) assume that this patch has been applied.

Cheers,
Sebastian

--

-- 
Sebastian "tokkee" Harl
GnuPG-ID: 0x8501C7FC
http://tokkee.org/

Staněk Luboš | 3 Dec 2006 15:49
Picon

Re: [PATCH] email plugin: Made socket settings configurable.

Hi Sebastian,
when you are making changes for the enhanced plugin's configuration,
would it be possible to make the socket path configurable too?

To Florian:
Because it is of the high probability that more plugins will use the
UNIX socket communication, would it be possible to make the socket path
prefix configurable by the autoconf script instead of the hardcoded '/tmp'?
It is common to have all sockets inside the application's directory in
the '/var/run' path in RedHat's distributions.

Back to Sebastian:
Would you be also able to add an ignorelist to the spam_check?

I think that it would be good to have the option to skip some of the
SpamAssassin's checks. It would be also possible to add such feature to
the SA plugin.

I am sorry, I did not have much time recently, but I will check it for sure.

Best regards,
Lubos

Sebastian Harl napsal(a):
> Added config file support to the email plugin.
> 
> The following options are available:
> * "SocketGroup <group name>"
>   Set the group the UNIX socket belongs to to <group name>.
> * "SocketPerms <perms>"
(Continue reading)

Florian Forster | 3 Dec 2006 18:45
Favicon

email plugin: Limit the `MaxConns' option by a hardcoded value.

From: Florian Forster <octo@...>

Because typos (and ``typos'', i. e. dumb users) happen, it's better to not
allow INT_MAX connections. The problem is that on 32bit machines this would
 a) create 2147483648 threads
 b) allocate (at least) 512 GBytes of memory
which would result in certain death of either the daemon or the system.

This patch limits the number of connections (and thus threads and allocated
memory) to 16384, which ought to be enough for most people. Those, who need
more connections (and can accomplish this, even though there are quite narrow
OS limits) will need to recompile themselves.

Signed-off-by: Florian Forster <octo@...>
---
 src/email.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/email.c b/src/email.c
index 6838ead..b799597 100644
--- a/src/email.c
+++ b/src/email.c
 <at>  <at>  -73,6 +73,7  <at>  <at> 

 #define SOCK_PATH "/tmp/.collectd-email"
 #define MAX_CONNS 5
+#define MAX_CONNS_LIMIT 16384

 /*
  * Private data structures
(Continue reading)


Gmane