Performance Issues

Chuck Foster chuck.foster at STREAMSHIELD.COM
Thu May 26 12:30:35 IST 2005


    [ The following text is in the "iso-8859-1" character set. ]
    [ Your display is set for the "US-ASCII" character set.  ]
    [ Some characters may be displayed incorrectly. ]

> On Behalf Of Martin Hepworth
> Sent: 23 May 2005 15:46
>
> Outgoing Queue Dir = /var/spool/exim.out/input/*
>
> Assumming that works?

That was the problem I hit last week, as the outgoing directory definition
didn't allow for multiple outgoing queues. Not too sure whether this works
for exim too, but what I ended up doing in custom function for this was as
follows:


package MailScanner::CustomConfig;

# SS_select_outqueue - custom function to select an outqueue for MailScanner
# based on when there might be several subdirectories to choose from,
notably
# for sendmail using split queues.
#
# Usage:
# Outgoing Queue Directory = &SS_select_outqueue( <pathtoqueue> [, verbose
output] )
#
# Example:
# Outgoing Queue Directory = &SS_select_outqueue('/var/spool/mqueue/q.*')
# Outgoing Queue Directory = &SS_select_outqueue('/var/spool/mqueue/q.*',
'v')
#
# Accepts the same format as the "Incoming Queue Directory" configuration.
# NOTE: we cannot handle directories which use  xf, tf, qf - that would
# have to be done in the main MailScanner code ...

use strict 'vars';
use strict 'refs';
no  strict 'subs'; # Allow bare words for parameter %'s

use vars qw($VERSION);

use FileHandle;

### The package version, both in 1.23 style *and* usable by MakeMaker:
$VERSION = substr q$Revision: 1.3 $, 10;



my $SS_directory_default = '/var/spool/mqueue';

my @SS_queue_directory;
my $SS_queue_directory_verbose = 0;
my $SS_queue_directory_total = 0;
my $SS_queue_directory_current = 0;



# Initialisation, based on Config::ReadInQueueDir to handle same parameters

sub InitSS_select_outqueue {
        my $tainted = $_[0]; # PercentVars/$ENV were done before function
call!
        $SS_queue_directory_verbose = $_[1];
        $tainted =~ /(.*)/;
        my $path = $1;

        if ($path eq '') {
                push @SS_queue_directory, $SS_directory_default;
        } elsif ($path =~ /[\?\*]/) {
                my @list = glob($path);
                push @SS_queue_directory, @list;
        } elsif (-d $path) {
                push @SS_queue_directory, $path;
        } elsif (-f $path) {
                my $listh = new FileHandle;
                $listh->open("<$path");
                while (<$listh>) {
                        chomp;
                        s/^#.*$//;
                        s/^\s*//;
                        s/\s*$//;
                        /^(.*)$/;
                        next if $1 eq "";
                        my $dir = $1;
                        $dir = MailScanner::Config::DoPercentVars($dir);
                        $dir =~ s/\$\{?(\w+)\}?/$ENV{$1}/g;
                        if ($dir =~ /[\?\*]/) {
                                my @list = glob($dir);
                                push @SS_queue_directory, @list;
                                next;
                        }
                        unless (-d $dir) {
                                next;
                        }
                        push @SS_queue_directory, $dir;
                }
                $listh->close();
        }
        unless ($SS_queue_directory_total = scalar(@SS_queue_directory)) {
                MailScanner::Log::DieLog("No outgoing queue directories
identified for '%s'", $path);
        }
        MailScanner::Log::WarnLog("Outgoing queues ready, %s in total: %s",
                        $SS_queue_directory_total,
                        join(',', at SS_queue_directory))
                if $SS_queue_directory_verbose;
}

sub EndSS_select_outqueue {
}


sub SS_select_outqueue {
        my ($m) = @_;
        $SS_queue_directory_current = 0
                if $SS_queue_directory_current == $SS_queue_directory_total;
        MailScanner::Log::WarnLog("Outgoing queue selected: %s for %s",
                        $SS_queue_directory[$SS_queue_directory_current],
                        ($m->{id}?$m->{id}:'(none)'))
                if $SS_queue_directory_verbose;
        return $SS_queue_directory[$SS_queue_directory_current++];
}

1;


This message should be regarded as confidential. If you have received this
email in error please notify the sender and destroy it immediately.
Statements of intent shall only become binding when confirmed in hard copy
by an authorized signatory.


--
This message has been scanned for all known viruses
and dangerous content by StreamShield Protector,
and has been found to be clean.

------------------------ MailScanner list ------------------------
To unsubscribe, email jiscmail at jiscmail.ac.uk with the words:
'leave mailscanner' in the body of the email.
Before posting, read the Wiki (http://wiki.mailscanner.info/) and
the archives (http://www.jiscmail.ac.uk/lists/mailscanner.html).

Support MailScanner development - buy the book off the website!




More information about the MailScanner mailing list