]> diplodocus.org Git - mdeliver/log
mdeliver
21 years agoInitial draft of mdeliver(1) man page.
dsp [Thu, 14 Oct 2004 20:13:01 +0000 (20:13 +0000)]
Initial draft of mdeliver(1) man page.

23 years agoRename the rcsid variable to ident, since this isn't an "RCS Id" after
epg [Thu, 10 Apr 2003 03:47:32 +0000 (03:47 +0000)]
Rename the rcsid variable to ident, since this isn't an "RCS Id" after
all.

23 years agomdeliver/current/mdeliver.c:
epg [Sun, 19 Jan 2003 03:11:14 +0000 (03:11 +0000)]
mdeliver/current/mdeliver.c:
    (deliver): In rev 1582 i changed this from using rename(2) to
    the recommended link(2) + unlink(2).  But in minc i was using
    open(2) + rename(2) instead, which is just as safe as link +
    unlink but with one advantage.  So switch to that model.

minc/current/minc:
    (store_message): Document the open + rename procedure and
    explain why it is used instead of link + unlink.

23 years ago(strip_from): I added a comment about my confidence in the
epg [Thu, 16 Jan 2003 20:40:57 +0000 (20:40 +0000)]
(strip_from): I added a comment about my confidence in the
read-first-five-bytes or fail bit a long time ago, but never
committed it.

23 years ago(deliver): Stick closer to the standard maildir delivery algorithm by
epg [Thu, 16 Jan 2003 17:59:18 +0000 (17:59 +0000)]
(deliver): Stick closer to the standard maildir delivery algorithm by
using link(2) + unlink(2) instead of rename(2) to get the message file
from tmp to new.  rename(2) will clobber an existing file, which we
don't want; link(2) will not.

Strictly speaking this is an impossible scenario for mdeliver, for
which one process delivers no more than one message.  It is, however,
not outside the realm of possibility that a filename identical to the
one chosen by mdeliver came into existence for some unrelated reason
(though the odds of this happening must be staggering).

Perhaps more importantly, it has been reported on the qmail list that
OpenBSD 3.2 will reuse the same PID in the same second, which would
mean this was a real problem on that system.

Whatever the case, this addresses any potential problems.

23 years agoGo back to using fork(2), since using vfork caused a segfault.
epg [Sat, 30 Nov 2002 08:11:36 +0000 (08:11 +0000)]
Go back to using fork(2), since using vfork caused a segfault.
Maybe i misunderstood something.  Worry about it later.

23 years ago(TMPNAMLEN): Whoops, forgot to account for the two dots in the temp
epg [Sat, 30 Nov 2002 07:25:13 +0000 (07:25 +0000)]
(TMPNAMLEN): Whoops, forgot to account for the two dots in the temp
file name.

23 years agoUse vfork(2) instead of fork(2).
epg [Tue, 17 Sep 2002 12:45:16 +0000 (12:45 +0000)]
Use vfork(2) instead of fork(2).

23 years agoMake run_processor work again.
epg [Fri, 13 Sep 2002 02:16:06 +0000 (02:16 +0000)]
Make run_processor work again.

23 years ago(run_processor): While there's nothing we can do if any of the
epg [Fri, 13 Sep 2002 01:49:16 +0000 (01:49 +0000)]
(run_processor): While there's nothing we can do if any of the
err-file-writing steps fail, there's no reason we can't be a little
more careful in doing it.  Do so (including using fflush, fsync,
and close).

23 years ago(run_processor): Now only takes a single argument, the filename of the
epg [Fri, 13 Sep 2002 01:43:09 +0000 (01:43 +0000)]
(run_processor): Now only takes a single argument, the filename of the
new message.  The process to run is now hard-coded to be a dot-file in
the user's home directory.

(main): Now unconditionally call run_processor.

23 years agoRename copy_message to copy_file, document it, and make it slightly
epg [Wed, 11 Sep 2002 02:12:04 +0000 (02:12 +0000)]
Rename copy_message to copy_file, document it, and make it slightly
more generic.  Now i can share it with other programs (for example, my
portable install(1)).

23 years ago(run_processor): New function.
epg [Sun, 8 Sep 2002 07:52:40 +0000 (07:52 +0000)]
(run_processor): New function.

(main): Move the logic of running the optional message processor to
the new run_processor function.

23 years ago(main): If running the optional program on the newly delivered message
epg [Fri, 6 Sep 2002 07:19:16 +0000 (07:19 +0000)]
(main): If running the optional program on the newly delivered message
fails, save errno before getting to work on creating an error file.

23 years ago(save_errno): New macro.
epg [Fri, 6 Sep 2002 07:08:49 +0000 (07:08 +0000)]
(save_errno): New macro.

Use save_errno to protect errno in the 101 places i was calling
unlink(2) and then err(3), possibly reporting the wrong error message.

23 years ago(get_filename): Handle failure cases for time(3) and gmtime(3).
epg [Fri, 6 Sep 2002 06:32:49 +0000 (06:32 +0000)]
(get_filename): Handle failure cases for time(3) and gmtime(3).

23 years ago(get_filename): Restore errno before returning.
epg [Fri, 6 Sep 2002 06:29:47 +0000 (06:29 +0000)]
(get_filename): Restore errno before returning.

23 years agoOnly include <sysexits.h> if MDELIVER_EXITCODE is not defined, and if
epg [Fri, 6 Sep 2002 05:58:27 +0000 (05:58 +0000)]
Only include <sysexits.h> if MDELIVER_EXITCODE is not defined, and if
it isn't defined, define it to EX_TEMPFAIL.  Change all references to
EX_TEMPFAIL to MDELIVER_EXITCODE.

23 years ago(strip_from): DOH! This will teach me to code at 2:30 in the middle
epg [Sun, 25 Aug 2002 07:39:04 +0000 (07:39 +0000)]
(strip_from): DOH!  This will teach me to code at 2:30 in the middle
of the night.  Use strncmp(3) correctly.

23 years agoDocument the get_filename, strip_from, and copy_message functions.
epg [Sun, 25 Aug 2002 07:22:41 +0000 (07:22 +0000)]
Document the get_filename, strip_from, and copy_message functions.

23 years ago(get_filename): Check gethostname(3) return value.
epg [Sun, 25 Aug 2002 07:11:23 +0000 (07:11 +0000)]
(get_filename): Check gethostname(3) return value.

23 years agoReorganize the deliver function, splitting out logical units into the
epg [Sun, 25 Aug 2002 07:05:50 +0000 (07:05 +0000)]
Reorganize the deliver function, splitting out logical units into the
separate functions deliver, get_filename, strip_from, and
copy_message.

(get_filename): Move deliver's filename-getting code to this new
function.

(strip_from): Move deliver's busted-from-line stripping code to this
new function.

(copy_message): Move deliver's stdin-to-new-file-copying code to this
new function.

(deliver): Call the above new functions appropriately.

23 years ago(deliver): Check for and strip 'From ' line that some broken mailers
epg [Sun, 25 Aug 2002 06:50:37 +0000 (06:50 +0000)]
(deliver): Check for and strip 'From ' line that some broken mailers
(such as Postfix) add as the first line of input.

23 years ago(deliver): Handle errors from read(2) on stdin.
epg [Sun, 25 Aug 2002 06:27:11 +0000 (06:27 +0000)]
(deliver): Handle errors from read(2) on stdin.

23 years ago(deliver): Create message files with mode 0600 instead of 0644.
epg [Sun, 25 Aug 2002 02:44:45 +0000 (02:44 +0000)]
(deliver): Create message files with mode 0600 instead of 0644.

23 years ago(main): Create the err directory before trying to store an error
epg [Sat, 24 Aug 2002 18:19:05 +0000 (18:19 +0000)]
(main): Create the err directory before trying to store an error
message in it.

23 years ago(main): Don't assume the current directory is the user's home
epg [Thu, 22 Aug 2002 04:08:30 +0000 (04:08 +0000)]
(main): Don't assume the current directory is the user's home
directory.  Get the HOME environment variable and chdir(2) there.

23 years ago(LDFLAGS): Set to -static.
epg [Thu, 22 Aug 2002 03:26:50 +0000 (03:26 +0000)]
(LDFLAGS): Set to -static.

23 years agoAdd program description comment at the top.
epg [Thu, 22 Aug 2002 03:25:28 +0000 (03:25 +0000)]
Add program description comment at the top.

23 years ago(rcsid): New global char[].
epg [Wed, 21 Aug 2002 07:20:34 +0000 (07:20 +0000)]
(rcsid): New global char[].

(main): Print rcsid and exit if -v is the first argument.

23 years agoSet svn:keywords to 'Id'.
epg [Wed, 21 Aug 2002 06:45:09 +0000 (06:45 +0000)]
Set svn:keywords to 'Id'.

23 years ago(main): Use execv(3) instead of execvp(3).
epg [Tue, 20 Aug 2002 22:36:00 +0000 (22:36 +0000)]
(main): Use execv(3) instead of execvp(3).

23 years agoInclude <limits.h>.
epg [Tue, 20 Aug 2002 05:46:34 +0000 (05:46 +0000)]
Include <limits.h>.

Define HOST_NAME_MAX if not set.  Use it instead of 64 for
gethostname(3).

Create new macro TMPNAMLEN for declaring maildir filename strings.

23 years agoNew program.
epg [Tue, 20 Aug 2002 05:07:37 +0000 (05:07 +0000)]
New program.

23 years ago(no commit message)
<> [Tue, 20 Aug 2002 05:07:36 +0000 (05:07 +0000)]