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.
markus schnalke [Thu, 22 Mar 2012 20:27:53 +0000 (21:27 +0100)]
scansbr: Removed the ``performance hack'' for inc as it wasn't faster.
I tested a 150MB/500msgs mbox but couldn't see any time differences. In both
cases it took 2-5s on my machine. Hence, I go for the much simpler and not
``we use strange internals'' version. If you really inc much larger mboxes,
then just take some time. ;-)
The explaining comment for the hack had been:
Performance hack: some people like to run "inc" on things like
net.sources or large digests. We do a copy directly into the output
buffer rather than going through an intermediate buffer.
We need the amount of data m_getfld found & don't want to do a
strlen on the long buffer so there's a hack in m_getfld to save the
amount of data it returned in the global "msg_count".
markus schnalke [Thu, 22 Mar 2012 20:07:50 +0000 (21:07 +0100)]
scansbr: Fixed scan and inc.
Writing to /dev/null had it's sense, as for scanning mboxes, the message size
had been determined this way and the file pointer had been pushed forward.
This is now done using the input file pointer instead of the output fp.
markus schnalke [Thu, 22 Mar 2012 17:50:10 +0000 (18:50 +0100)]
scansbr: Only write to file if we're incing, but not when scanning.
If the original author would have used logical flags instead of magic
values in `outnum', the code wouldn't have been broken all the time.
Writing to /dev/null instead of not writing at all ... oh my! :-/
markus schnalke [Thu, 22 Mar 2012 16:46:06 +0000 (17:46 +0100)]
Removed the DBMPWD (aka. DBM) define. It was per default enabled, anyway.
The explanation of this option is:
For sites with a dbm-style password file (such as with Yellow Pages),
MH will not read the entire passwd file into a cache. At one site
that runs YP on a large passwd file, using this showed a 6:1 performance
improvement.
I don't like performance optimization, but if the non-cached version is
faster, then we surely take that one.