Important ZMailer patch

Mariano Absatz mailscanner at LISTS.COM.AR
Wed Mar 31 21:17:37 IST 2004


El 31 Mar 2004 a las 20:06, Julian Field escribió:

> I have just applied the patch, seemed to go okay. This will be in
> tomorrow's stable release.
Great!

I have another thing we developed that is optional, but high traffic people 
may need it.

The original (current) MailScanner+ZMailer implementation only supports a 
single 'Incoming Queue Dir'... at least, ZMailer-wise.

The point is that, when ZMailer uses directory hashes for the smtpserver (the 
process 'before' MailScanner), it must also use them for the router (the 
process 'after' MailScanner)... that is, there's a ZMailer setting (not used 
by default, but very recommended when you handle hundreds of message a 
minute) that allows you to spread the queue directory in 26 subdirectories 
(named A thru Z)... but if you configure the smtpserver to use that 
structure, the router will look in the same structure, so you must spread 
MailScanner output queue files in the 26 directories.

That is, if you say:
Incoming Queue Dir = /var/spool/postoffice-incoming/router/?

You should also say:
Outgoing Queue Dir = /var/spool/postoffice/router/?

But that last setting is completely invalid.

You might just say:
Outgoing Queue Dir = /var/spool/postoffice/router/a

and you'd be using 26 dirs for input and only one for output, but at least 
one that is checked by the router... anyway, we developed a small set of 
functions that you can put in CustomConfig.pm (or in the brand new 
CustomFunctions directory) and get it right.

The setting (in MailScanner.conf) becomes:
Outgoing Queue Dir = &ChooseZMOutQueueDir

We've already tested and it works.


================= CUT HERE AND PASTE IN CustomConfig.pm ==================
# ZMailer only: if you have set 
# ROUTERDIRHASH=1
# in your zmailer.conf you have to put (in MailScanner.conf) the
# following settings:
#
# Incoming Queue Dir = /var/spool/postoffice-incoming/router/?
# Outgoing Queue Dir = &ChooseZMOutQueueDir

my @zmaileroutdirs=("/var/spool/postoffice/router/?");

sub InitChooseZMOutQueueDir {
  my @aux=@zmaileroutdirs;
  @zmaileroutdirs=();
  for (@aux) {
    push @zmaileroutdirs, ( /[\*\?\{]/ ) ? glob($_) : $_;
    if( ! -d $zmaileroutdirs[-1] ) {
      MailScanner::Log::DieLog("Some outgoing queue dirs aren't dirs" .
                           " (%s)", $zmaileroutdirs[-1]);
    }
  }
  unless( @aux ) {
    MailScanner::Log::DieLog("zmaileroutdirs is empty");
  }
}
sub EndChooseZMOutQueueDir {
}
sub ChooseZMOutQueueDir {
  return $zmaileroutdirs[rand( int( @zmaileroutdirs ) ) ];
}
======================== CUT HERE =========================


It could be a bit more foolproof (e.g. we may want to do something à la 
'CheckQueuesAreTogether' for these directories), but if you are doing this, 
you should know what you're doing...


--
Mariano Absatz
El Baby
----------------------------------------------------------
Macho Law forbids me from admitting I'm wrong.




More information about the MailScanner mailing list