![]()
From: William R. Knox (wknox@mitre.org)
Date: Thu Jan 10 2002 - 11:17:23 CST
I have problem wherein I occasionally get messages that indicate that
hypermail could not create a directory on the first message in a new
folder. Here is what the bounced message looks like:
----- The following addresses had permanent fatal errors -----
"|/usr/local/bin/hypermail -u -i -c /apps/mitre/etc/hmrc.alex"
(expanded from: <alexarch@oraadm.mitre.org>)
----- Transcript of session follows -----
hypermail: Can not create directory "/apps/webcontent/docs/mail/alex-archives/Jan-10-2002".
554 5.3.0 "|/usr/local/bin/hypermail -u -i -c /apps/mitre/etc/hmrc.alex"... unknown mailer error 255
I suspect that it is from a race condition in the checkdir function in the
lines
if (stat(dir, &sbuf)) {
if (errno != ENOENT || mkdir(dir, set_dirmode) < 0) {
The errno is filled in by a stat on the directory in the prior line - if
two incoming messages arrive at close to exactly the same time, it is
possible that they will arrive at this point at nearly the exact same time
and will both think the directory in question does not exist - when one
tries to create it, it will then fail because the other one has created in
the previous instant and will then ounce the message (at least under my
setup). In order to prevent this, I have a patch for file.c (I also patch
check1dir, just because it could happen there, too):
--- hypermail-2.1.3/src/file.c Wed Jul 25 19:52:12 2001
+++ hypermail-2.1.3-patched/src/file.c Thu Jan 10 09:28:27 2002
@@ -65,9 +65,11 @@
if (stat(dir, &sbuf)) {
if (errno != ENOENT || mkdir(dir, set_dirmode) < 0) {
- sprintf(errmsg, "%s \"%s\".",
- lang[MSG_CANNOT_CREATE_DIRECTORY], dir);
- progerr(errmsg);
+ if (errno != EEXIST) {
+ sprintf(errmsg, "%s \"%s\".",
+ lang[MSG_CANNOT_CREATE_DIRECTORY], dir);
+ progerr(errmsg);
+ }
return;
}
else if (set_showprogress)
@@ -104,9 +106,11 @@
*p = '\0';
if (stat(dir, &sbuf)) {
if (errno != ENOENT || mkdir(dir, set_dirmode) < 0) {
- sprintf(errmsg, "%s \"%s\".",
- lang[MSG_CANNOT_CREATE_DIRECTORY], dir);
- progerr(errmsg);
+ if (errno != EEXIST) {
+ sprintf(errmsg, "%s \"%s\".",
+ lang[MSG_CANNOT_CREATE_DIRECTORY],
dir);
+ progerr(errmsg);
+ }
return;
}
else if (set_showprogress)
I see this problem only rarely (every other month or so), so I can't say
whether this will fix it, but I've not come up with anything better.
Anyone else having this sort of trouble? Care to comment? Below is the
relevant line from my config file and from my mail aliases file - if this
is a terrible way to set things up, can someone let me know? Thanks in
advance.
hmrc.alex
---------
dir = /apps/webcontent/docs/mail/alex-archives/%M-%d-%y
aliases file
------------
alexarch: "|/usr/local/bin/hypermail -u -i -c /apps/mitre/etc/hmrc.alex"
Bill Knox
Senior Operating Systems Programmer/Analyst
The MITRE Corporation
![]()