[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Zmailer and Majordomo troubles
> On Tue, 19 Mar 1996, Matti Aarnio wrote:
> > Hmm.. Add "majordomo" into group "zmailer" at /etc/groups.
> > That should do it by making Majordomo to be a "trusted" sender,
> > which can "fake" emails by free fill..
>
> Ok, that's the first I've seen of the zmailer group, I just had to create
> it, is there anything else, users or files, that should be in that group?
Depends.. I have:
mea,daemon,root
at couple servers, but at my workstation I have none.
The "daemon" is needed (for error reports to be "faked" at will..)
> > > And I'm still having a nagging problem with mailbox not preserving
> > > accessed time so user's new mail isn't reported.
> >
> > I am mystified by this. It SHOULD preserve them, but why it
> > does not ? Should the access time be reset, after the file
> > is closed ? (never mind that it is not READ after the access-
> > time reset has been done, only written, but the fd was opened
> > for read/write.. ... it does work at Sun Solaris 2.4, in this
> > form, though..)
> >
> > What operating system do you use ?
>
> Linux. I believe I've seen this problem with kernels 1.3.(57|71|74).
I am afraid it has something to do with the way how Linux handles
inode attribute management. Especially UPDATE management..
I will ask about it in the Linux kernel forum. (browsing kernel
source just tells me that it is prone to do surprises.. It looks
to me that a file open for RDWR will always be updated both atime,
and mtime even if only really written to..)
Perhaps this will help: (I am now assuming that file lock dissolving,
and closeing will not cause mtime/atime to be updated, but one never
knows, until it is confirmed either way..)
sol:/opt/src/mea/zmailer-2.99.26/transports/mailbox|509$ /opt/gnu/bin/diff -u mailbox.c~ mailbox.c
--- mailbox.c~ Thu Mar 14 10:01:21 1996
+++ mailbox.c Tue Mar 19 10:54:22 1996
@@ -1130,7 +1130,8 @@
ftruncate(FILENO(fp), (u_long)eofindex);
#endif /* USE_FTRUNCATE */
fclose(fp);
- return NULL;
+ fp = NULL;
+ goto time_reset;
}
}
} else if (eofindex > 0L && eofindex < (sizeof "From x\n")) {
@@ -1164,7 +1165,8 @@
if (eofindex >= 0)
ftruncate(FILENO(fp), (u_long)eofindex);
fclose(fp);
- return NULL;
+ fp = NULL;
+ goto time_reset;
}
lastch = appendlet(dp, rp, fp, file, is_mime);
@@ -1174,7 +1176,8 @@
if (eofindex >= 0)
ftruncate(FILENO(fp), (u_long)eofindex);
fclose(fp);
- return NULL;
+ fp = NULL;
+ goto time_reset;
}
/* End of the file, and MMDF-style ? */
@@ -1196,7 +1199,8 @@
if (eofindex >= 0)
ftruncate(FILENO(fp), (u_long)eofindex);
fclose(fp);
- return NULL;
+ fp = NULL;
+ goto time_reset;
}
if (logfp != NULL) {
/* [haa@cs.hut.fi] added more info here to catch errors
@@ -1213,6 +1217,24 @@
#endif
fflush(logfp);
}
+
+ time_reset:
+
+ if (st.st_atime != 0) {
+#ifdef USE_TIMEVAL
+ struct timeval tv[2];
+ tv[0].tv_sec = st.st_atime;
+ tv[1].tv_sec = st.st_mtime;
+ tv[0].tv_usec = tv[1].tv_usec = 0;
+ rc = utimes(file, tv);
+#else /* !USE_TIMEVAL */
+ struct utimbuf tv;
+ tv.actime = st.st_atime;
+ tv.modtime = st.st_mtime;
+ rc = utime(file, &tv);
+#endif /* USE_TIMEVAL */
+ }
+
return fp;
}
> --
> "Love the dolphins," she advised him. "Write by W.A.S.T.E.."
/Matti Aarnio