-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathqueue-rename
38 lines (33 loc) · 1.46 KB
/
queue-rename
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From: Harald Hanche-Olsen <[email protected]>
Subject: Re: (OT) Need queue-fix...
Date: Sun, 07 Mar 1999 13:28:12 +0100
- Pedro Melo <[email protected]>:
| I'm sorry to bring this to the list, but...
|
| I need queue-fix from www.qmail.org but the domain netmeridian.com
| where the package is located vanished from DNS... Does anybody has a
| copy? Can you send it to me?
Don't use queue-fix. It has a bug that can lose mail for you. I have
alerted the author about the bug, and hopefully he will fix it. But
in the mean time, I cannot recommend the program.
If your problem is due to a restore or moving your queue to a new file
system, one solution is to have messages from your old queue in
/var/qmail/queue.old, a brand new empty queue in /var/qmail/queue, and
run the following script (which requires GNU find):
#!/bin/sh -x
cd /var/qmail || exit 1
find queue.old/mess -type f -printf '%f %i\n' |
awk '{print $1, $1%23, $2, $2%23}' |
while read oldi oldd newi newd; do
mv queue.old/mess/$oldd/$oldi queue/mess/$newd/$newi
mv queue.old/info/$oldd/$oldi queue/info/$newd/$newi
test -f queue.old/local/$oldd/$oldi &&
mv queue.old/local/$oldd/$oldi queue/local/$newd/$newi
test -f queue.old/remote/$oldd/$oldi &&
mv queue.old/remote/$oldd/$oldi queue/remote/$newd/$newi
test -f queue.old/bounce/$oldi &&
mv queue.old/bounce/$oldi queue/bounce/$newi
test -f queue.old/todo/$oldi &&
mv queue.old/todo/$oldi queue/todo/$newi
done