README
author tomas@localhost
Thu, 01 Nov 2007 14:46:11 +0100
changeset 0 c045670f36e9
permissions -rw-r--r--
Imported queue-fix-1.4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
     1
queue-fix 1.4
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
     2
19990314
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
     3
Copyright 1999
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
     4
Eric Huss
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
     5
e-huss@netmeridian.com
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
     6
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
     7
This is a small utility for checking and repairing the qmail queue
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
     8
structure.  It will fix uid/gid settings and permissions.  It will
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
     9
rename the message files to match their inodes.  It will even create
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    10
directories and files that don't exist that should be there (you can
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    11
even create a queue from scratch).  It will also print warnings for
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    12
any files it finds that should not exist.
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    13
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    14
Compiling:
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    15
1) Extract the tar file.
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    16
2) Edit conf-cc and conf-ld for your compiler.
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    17
3) If you changed conf-split when you compiled qmail, edit queue-fix.c
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    18
and change SPLIT_NUM to this value.
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    19
4) Type make.
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    20
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    21
This will produce the "queue-fix" executable.
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    22
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    23
How to use:
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    24
	queue-fix [-i | -N] queue_directory
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    25
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    26
Use the -i option to go into interactive mode.  In interactive mode,
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    27
it will prompt for confirmation before it begins a task.
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    28
Alternatively, you may use the -N option to go into test mode.
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    29
In test mode, queue-fix will print to standard output all the actions
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    30
queue-fix would normally do, but does not actually call them.
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    31
queue_directory is the location of the queue to fix.
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    32
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    33
For your safety, you should always make a backup of your queue before
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    34
running queue-fix.
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    35
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    36
Examples:
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    37
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    38
1) Moving your queue.
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    39
     a) Shut down qmail-send.  Wait for exiting to show up in the log.
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    40
        Shut down qmail-smptd:
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    41
             - if inetd, comment out of /etc/inetd.conf and send inetd
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    42
               a HUP.
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    43
             - if supervise, use svc -d to bring it down
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    44
        Shut down any processes which may run qmail-queue.  This includes,
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    45
        but is not limited to qmqpd, pop, imapd, etc.
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    46
     b) Choose the location for the new home of your queue.  In this
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    47
        example:  originally in /var/qmail/queue
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    48
                  moving to /other/qmail/queue
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    49
     c) cd /var/qmail
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    50
     d) mv queue /other/qmail
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    51
     e) queue-fix -i /other/qmail/queue
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    52
     f) Run queue-fix again just to make sure it worked.  If it prints
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    53
        anything other than finished, then something is seriously
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    54
        wrong.
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    55
     g) Either make a link to the new queue location, or recompile
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    56
        qmail with the new queue location.
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    57
     h) Restart qmail and test it.
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    58
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    59
2) Reconstructing the file system.
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    60
     a) Shut down qmail-send.  Wait for exiting to show up in the log.
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    61
        Shut down qmail-smptd:
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    62
             - if inetd, comment out of /etc/inetd.conf and send inetd
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    63
               a HUP.
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    64
             - if supervise, use svc -d to bring it down
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    65
        Shut down any processes which may run qmail-queue.  This includes,
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    66
        but is not limited to qmqpd, pop, imapd, etc.
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    67
     b) Do whatever file system changes that you need to do.
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    68
     c) queue-fix -i /var/qmail/queue
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    69
     d) Run queue-fix again just to make sure it worked.  If it prints
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    70
        anything other than finished, then something is seriously
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    71
        wrong.
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    72
     e) Restart qmail and test it.
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    73
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    74
Extra Safety:
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    75
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    76
You must ensure that no other program modifies the queue while queue-fix
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    77
is running.  If you are unsure whether or not something will try to use
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    78
the queue, type:
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    79
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    80
     chmod 0 /var/qmail/bin/qmail-queue
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    81
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    82
before running queue-fix.  This will assume that MUA's and other applications
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    83
that inject mail will recognize the failure to run qmail-queue.
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    84
Once you are done, type:
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    85
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    86
     chmod 4711 /var/qmail/bin/qmail-queue
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    87
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    88
to get it going again.
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    89
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    90
Known faults:
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    91
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    92
- The error messages are not very descriptive of the problem.
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    93
- Responding "no" during interactive mode results in a confusing
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    94
  error message.
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    95
- queue-fix checks for special files to exist in the queue, but does
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    96
  not check their type (for example, a regular file existing where
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    97
  there should be a named pipe).
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    98
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
    99
Epilogue:
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
   100
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
   101
If you have problems, please let me know.  I make no guarantees about
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
   102
the quality of this program.
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
   103
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
   104
This utility as an experiment uses the libraries written by D. J.
c045670f36e9 Imported queue-fix-1.4
tomas@localhost
parents:
diff changeset
   105
Bernstein.  Thanks!