Moving Mail between Scanners

Mariano Absatz mailscanner at LISTS.COM.AR
Fri Sep 5 18:21:29 IST 2003


Well...

you can't have it all, that is, some of the mail "in process" will have to be 
reprocessed, but you will (quite probably) not lose any message by following 
this procedure:

As the standard init.d script doesn't allow for individual service handling, 
the easiest way to keep the output queue being processed while leaving 
everything else stopped (so the input queue which you'll be fiddling with 
doesn't get corrupted) is the following:
     service MailScanner stop
(what 10 seconds approx. given that MailScanner processes take a while)
this will have stopped everything.

Regretfully, the half-processed messages at this point are discarded, but 
they will be processed again later. This will include at most "Max Children" 
messages (as configured in your MailScanner.conf file, default=5). It is a 
relatively small price.

Now keep the outgoing sendmail (or whatever mta you're using) going:
     service MailScanner startout

Now you have to look in the incoming queue directory(ies) (they're specified 
in MailScanner.conf as "Incoming Queue Dir =") and take the files from there 
to the other servers (you can include the current server among the ones that 
get part of the share).

If you're using a 2-file queue MTA (sendmail or Exim) you have to move the 
files in pairs (q file & d file).

Suppose you have:
qf200309051122335321
df200309051122335321
qf200309051122333161
df200309051122333161
qf200309051122412612
df200309051122412612

you can decide to move the qf200309051122335321+df200309051122335321 pair to 
server1, the qf200309051122333161+df200309051122333161 pair to server2 and 
leave qf200309051122412612+df200309051122412612 in the current server 
(server0).

First move the files you will move out from /var/spool/mqueue.in (or whatever 
incoming queue directory) to some place else
Create the following directories in the _SAME_ filesystem as your incoming 
queue directory:
mkdir /var/spool/migrate.2.server1
mkdir /var/spool/migrate.2.server2
mv qf200309051122335321 df200309051122335321 /var/spool/migrate.2.server1
mv qf200309051122333161 df200309051122333161 /var/spool/migrate.2.server2
(you'll have to script this reasonably and not do it manually).

Once you've taken this queue files off the incoming spool, you can start all 
of MailScanner in server0 so it keeps processing.
     service MailScanner start

In the destination servers, create one new directory in the _SAME_ filesystem 
as the incoming queue dir (it is _KEY_ for this to work that everything is in 
the same filesystem):
mkdir /var/spool/migrated.from.server0

Now, copy the files to the new servers:
  scp /var/spool/migrate.2.server1/* server1:/var/spool/migrated.from.server0
  scp /var/spool/migrate.2.server2/* server2:/var/spool/migrated.from.server0

Now in each of the new servers do:
  mv /var/spool/migrated.from.server0/df* /var/spool/mqueue.in
  mv /var/spool/migrated.from.server0/qf* /var/spool/mqueue.in

The order is important, since MailScanner first looks for the qf file and 
then for the df file, so, by the time the qf file is found, you are sure that 
the corresponding qf file is already there.

The "mv" inside a filesystem guarantees you that the file is complete by the 
time it is inserted in the queue directory.


El 5 Sep 2003 a las 11:51, Errol Neal escribió:

> Hi all,
> 
> I have a MailScanner that is about 13 hrs behind in terms of mail delivery.
> I need to move part of the queued mail onto another Scanner. What is the
> best way to do this while taking into consideration the mail already
> unpacked and probably half processed?
> 
> 
> Errol Neal
> 
> Errol Neal, Systems/Network Administrator
> eneal at enhtech.com
> Enhanced Technologies Inc.
> http://www.enhtech.com
> 703-924-0301 or 800-368-3249
> 703-924-0302 Fax


--
Mariano Absatz
El Baby
----------------------------------------------------------
Lottery: A tax on people who are bad at math.




More information about the MailScanner mailing list