Ventosus | 1 Mar 2008 14:32
Picon

problem with simple content_log plugin

Hi.. Im trying to understand how qpsmtpd ticks, and have a small problem

the plugin: content_log is not working for some reason.

my plugins file looks like this

check_relay
require_resolvable_fromhost
rcpt_ok
content_log
$include /etc/qpsmtpd/debian-queue-method

my qpsmtpd install is a ubuntu 7.10 with postfix

Thanks in advance
Vent

Charlie Brady | 1 Mar 2008 16:38
Picon
Picon

Re: problem with simple content_log plugin


On Sat, 1 Mar 2008, Ventosus wrote:

> Hi.. Im trying to understand how qpsmtpd ticks, and have a small problem
>
> the plugin: content_log is not working for some reason.

Unless you define "not working" then nobody is likely to be able to help 
you. Do you mean, for instance, that it is just lazy, and sits around 
watching television?

> my plugins file looks like this
>
> check_relay
> require_resolvable_fromhost
> rcpt_ok
> content_log
> $include /etc/qpsmtpd/debian-queue-method

And what happens? What happens if you remove content_log?

Ask Bjørn Hansen | 3 Mar 2008 09:38
Gravatar

Re: Warning in the install process


On Feb 29, 2008, at 8:26, Francisco Valladolid wrote:

> WARNING: Setting ABSTRACT via file 'README' failed

Thanks; fixed in SVN (r850).

  - ask

--

-- 
http://www.askbjoernhansen.com/

crayon | 7 Mar 2008 19:02
Favicon

hook_helo_parse working?

I'm trying to write a plugin that uses hook_helo_parse but am not having 
any success. Some debugging shows my function gets called, it returns a 
CODE ref, but the ref'd sub never gets called here's a simple example:

sub hook_helo_parse {
    my $self = shift;
    my $ref = \&parser;
    $self->qp->log(LOGALERT, "hook_helo_parse called and returning $ref");
    return(OK, $ref);
}

sub parser {
    my( $self, $cmd, $line) =  <at> _;
    $self->qp->log(LOGALERT, "helo parser called for $cmd and $line");
    return(OK, $line);
}

When run I see the first alert, but not the second- does anyone else 
have a plugin using this hook that's working? I'm using qpsmtpd-0.40 and 
the async server if that makes any difference.

Steve Kemp | 7 Mar 2008 22:39
Picon
Favicon
Gravatar

new plugin: check_system_load


  This seems like rather an obvious idea:  Reject new
 connections if the system load is too high.  But surprisingly
 there seem to be no plugins which I could find implementing it.

  So here's mine:

    http://mail-scanning.com/qpsmtpd/system-load

  This reads /etc/qpsmtpd/max_system_load, and if the system load
 is equal or higher than the value contained within it it is rejected.

   Comments welcome, and I'm happy for it to be used in the core, or in
  contrib if there is any interest.

Steve
--

-- 
http://mail-scanning.com/

Peter Eisch | 7 Mar 2008 23:17

Re: new plugin: check_system_load

On 3/7/08 3:39 PM, "Steve Kemp" <steve <at> steve.org.uk> wrote:

> 
> This seems like rather an obvious idea:  Reject new
> connections if the system load is too high.  But surprisingly
> there seem to be no plugins which I could find implementing it.
> 

I had posted this one to the list back a couple years ago.  It works on
linux, bsd'en and solaris.  Maybe on hpux too.

peter

#!/usr/bin/perl

=head1 NAME

loadcheck

=head1 DESCRIPTION

Only takes email transactions if the system load is at or below a
specified level.  

=head1 CONFIG

max_load

  This is the 1 minute system load where we won't take transactions
if our load is higher than this value.  (Default: 7)
(Continue reading)

Matt Sergeant | 7 Mar 2008 23:48
Favicon

Re: new plugin: check_system_load

Note - you'd be better off using Linux::SysInfo (on Linux, obviously)  
to save the backtick call.

On 7-Mar-08, at 4:39 PM, Steve Kemp wrote:

>
>   This seems like rather an obvious idea:  Reject new
>  connections if the system load is too high.  But surprisingly
>  there seem to be no plugins which I could find implementing it.
>
>   So here's mine:
>
>     http://mail-scanning.com/qpsmtpd/system-load
>
>   This reads /etc/qpsmtpd/max_system_load, and if the system load
>  is equal or higher than the value contained within it it is rejected.
>
>
>    Comments welcome, and I'm happy for it to be used in the core,  
> or in
>   contrib if there is any interest.
>
> Steve
> -- 
> http://mail-scanning.com/
>

Steve Kemp | 8 Mar 2008 00:06
Picon
Favicon
Gravatar

Re: new plugin: check_system_load

On Fri Mar 07, 2008 at 17:48:22 -0500, Matt Sergeant wrote:

> Note - you'd be better off using Linux::SysInfo (on Linux, obviously) to 
> save the backtick call.

  Noted.  I'll update the code to use that where possible.  (Right now
 I figured portability would be a good thing - although I realise my
 regexp fails there!)

Steve
--

-- 

Juerd Waalboer | 8 Mar 2008 16:08
Picon

Re: new plugin: check_system_load

Peter Eisch skribis 2008-03-07 16:17 (-0600):
>   $self->{_args}->{uptime} = '/usr/bin/uptime'
>       if (! defined $self->{_args}->{uptime});
> (...)
>   my $res = `$self->{_args}->{uptime}`;

Especially during high load, forking and executing uptime may not be
such a wise thing to do, depending on how well your platform handles
this under high load.
--

-- 
Met vriendelijke groet,  Kind regards,  Korajn salutojn,

  Juerd Waalboer:  Perl hacker  <##### <at> juerd.nl>  <http://juerd.nl/sig>
  Convolution:     ICT solutions and consultancy <sales <at> convolution.nl>

Peter Eisch | 8 Mar 2008 17:02

Re: new plugin: check_system_load

On Sat, 8 Mar 2008 16:08:10 +0100
Juerd Waalboer <juerd <at> convolution.nl> wrote:

> Peter Eisch skribis 2008-03-07 16:17 (-0600):
> >   $self->{_args}->{uptime} = '/usr/bin/uptime'
> >       if (! defined $self->{_args}->{uptime});
> > (...)
> >   my $res = `$self->{_args}->{uptime}`;
> 
> Especially during high load, forking and executing uptime may not be
> such a wise thing to do, depending on how well your platform handles
> this under high load.

True.  The goal is to avoid swamping the system.  

I'm happy to take patches that keep the plugin universal and gather the
stats better.


Gmane