markus schnalke [Tue, 27 Mar 2012 13:07:59 +0000 (15:07 +0200)]
Fixed two fd leaks in mhparse.c.
1) In openQuoted(), the decoded contents file was opened twice in
succession. The second open was added by a patch in March 2000.
2) openBase64(), openQuoted(), and open7Bit() could open the contents
file, but it never would be closed. Added code to each to close the
file if the function opened it.
[Bug #24004: (debbug 344182)]
markus schnalke [Tue, 27 Mar 2012 12:20:24 +0000 (14:20 +0200)]
Fixed `mhbuild -check': use the correct file.
mhbuild -check would always fail because it tried to build the digest
for the decoded contents file (cefile), which can be null. If it is, use
the contents file itself.
markus schnalke [Tue, 27 Mar 2012 10:33:35 +0000 (12:33 +0200)]
new: Improve the fix with the NULL-sentinel.
With multiple sequence arguments on the command line you might end up
with garbage in the sequence[] array (it needs the last argument to be
a NULL. So do two things: make the first two arguments NULL, and as we
add arguments to sequence[] make sure the list has a NULL on the end.
This is another problem discovered by the nmh test suite.
markus schnalke [Tue, 27 Mar 2012 10:12:06 +0000 (12:12 +0200)]
We have only numeric timezone support (e.g. +0200) from now on.
That's an mmh decision. Pulled in from nmh is the following part:
Removed use of tzset()/tzname in dtimezone(). They caused the returned
timezone string to be for the user's current timezone, but the function
is supposed to return the string representation of the timezone of its
argument.
markus schnalke [Tue, 27 Mar 2012 09:03:04 +0000 (11:03 +0200)]
FreeBSD needs the HAVE_STRUCT_TM_TM_GMTOFF test.
FreeBSD has a timezone() function, not a timezone global variable
(that's visible with our default configuration).
Undid most of 0e4bc6fa7fa8ad74a1c3e855411bdc0e63bc6a2e.
markus schnalke [Tue, 27 Mar 2012 07:46:59 +0000 (09:46 +0200)]
Proper field initialization.
gcc -Wmissing-field-initializers noticed several struct initializations
that didn't explicitly list all fields. They were of no consequence because
they were for static data, so they were initialized properly.
Also, changed the initialization of global.c_ovtxt from "" to NULL because
free_queue () freed it if non-NULL, though I think the "" was always
overwritten.
markus schnalke [Tue, 27 Mar 2012 07:10:44 +0000 (09:10 +0200)]
Completely remove the use of TIME_WITH_SYS_TIME.
Removed the autoconf test but never removed the code, and this caused
some problems on systems that needed some prototypes in <time.h>.
markus schnalke [Mon, 26 Mar 2012 22:22:33 +0000 (00:22 +0200)]
The result from the call to parse_mime() was ignored.
Detected by `gcc -Wempty-body'. It has been that way since the beginning
of history and was probably of no consequence, but fixed anyway.
markus schnalke [Mon, 26 Mar 2012 22:13:25 +0000 (00:13 +0200)]
Added Content-Description header with the filename of the attachment.
This seems to be common practice now and gives mhlist something useful
to display.
markus schnalke [Mon, 26 Mar 2012 21:53:15 +0000 (23:53 +0200)]
Remove RPATH code though. Discussions on nmh-workers have convinced me.
[2012-01-05] Lyndon Nerenberg:
> [2012-01-05] Ken Hornstein:
>> RPATHS - Construct Return-Path headers from "From " lines.
>> I say keep it, since it's been around forever (a fair
>> amount of code, actually).
> I'm going to argue for the removal of this code, as well. The
> Return-Path header should be inserted by the delivering MTA, and I
> can't think of any modern MTA that doesn't.
markus schnalke [Mon, 26 Mar 2012 12:00:09 +0000 (14:00 +0200)]
Removed conflict(8), because checking passwd, /var/mail, etc. is not our job.
Conflict did check for:
- duplicate users
- duplicate groups
- existence of group members
- valid group ids
- orphaned maildrops
... and by the way for valid format of alias files.
The latter task can be covered by ali(1) without address arguments.
All the other tasks have nothing to do with the MUA. Actually, most of
them can be covered with shell one-liners.
markus schnalke [Sat, 24 Mar 2012 17:30:19 +0000 (18:30 +0100)]
CHANGE OF THE DECADE: I finally gave m_unknown() a name: thisisanmbox().
The ``magic invocation'' of this function informs m_getfld() that it is
reading a packed mbox file and not an MH-style (one-file-per-message) file.
m_getfld() needs to care for message delimiters then. The ``magic'' of
m_unknown() had vanished some time ago, already. Back then, it needed to
guess which kind of mailbox format the file is. With dropping the support
for MMDF (^A^A^A^A) maildrops, we converted m_unknown() into a plain dump
function ... and now, it also got a boring name. Well ...
markus schnalke [Sat, 24 Mar 2012 14:47:11 +0000 (15:47 +0100)]
Replaced folder_exists() by a call to create_folder().
Changed inc(1) to create non-existing folders with -silent, instead of
silently failing in this case. I consider the new behavior to follow the POLS.
markus schnalke [Sat, 24 Mar 2012 14:41:46 +0000 (15:41 +0100)]
Fixed `inc -silent' by not building a scan line if we don't want to print it.
scan() is still ugly and I'm still not pleased with the scan/inc merge,
but I don't see a better solution yet.
markus schnalke [Fri, 23 Mar 2012 11:20:01 +0000 (12:20 +0100)]
Fixed building in a separate build directory.
Like this:
mkdir /tmp/foo
cd /tmp/foo
/path/to/sources/configure -q
make
If you want to know more, search for VPATH.
markus schnalke [Fri, 23 Mar 2012 08:43:17 +0000 (09:43 +0100)]
makedir(): Removed the strange RUID!=EUID code and the access(2) call.
Dan couldn't find a reason for the code neither, hence I assume it's save
to simply remove it.
Ummm, why do we want to avoid creating directories
with the effective user ID? None of the nmh tools are
installed such that the effective should be different
from the real, and if some parent process made the two
be different, I don't see why it should be our job to
enforce the real UID. Also, why the heck do we call
the mkdir executable rather than the library function in
this case?? If we do want to call the mkdir executable,
we should at least be giving it -p (and change the single
chmod() call below) so it can successfully create nested
directories like the above code can.
-- Dan Harkless <dan-nmh@dilvish.speed.net>
Concerning access(2): We should better always just try the action instead
of first asking if we are allowed to do it.