Philipp Takacs [Sun, 31 Jan 2016 18:47:23 +0000 (19:47 +0100)]
simple mbox support for rcvstore
Some MTA(opensmtpd) add a ``From '' line ad the head of
mails befor handling the mail to a .forwoad MDA. m_getfld2
don't support such mails, so rcvstore should handle this
mbox-like mails.
markus schnalke [Thu, 12 Nov 2015 20:48:32 +0000 (21:48 +0100)]
Finally we get rid of the unmaintainable m_getfld()!
m_getfld() was about 700 lines, 300 of them being comments -- that's 42%!
m_getfld2() is 240 lines, 30 of them being comments. That's only half as
much code. Most important, however, is that this code is understandable
and thus maintainable. We escaped the dead end of the heavily optimized
m_getfld() be re-writing it from scratch. (Thanks to Philipp Tacaks!)
m_getfld2() is line-based and not character-based like m_getfld(). This
change spared us to keep digging into stdio internals or implementing
our own I/O buffering. We are now portable to any standard-conforming
stdio implementation.
markus schnalke [Thu, 12 Nov 2015 19:12:02 +0000 (20:12 +0100)]
Only lines consisting of nothing but dashes are body separators
This is how the documentation specifies it, see mh-mail(5). The old
m_getfld(), however, was more relaxed and treated any header line that
starts with a dash as the body separator. We are more strict here,
because ``-foo: bar'' is a valid header line (according to RFC 2822),
that should thus not be treated as the body separator, whereas a line
``------'' in the header could only be a format error if we don't
take it as the body separator.
markus schnalke [Mon, 9 Nov 2015 21:08:51 +0000 (22:08 +0100)]
Adjust the tests to less tolerant m_getfld2()
We require the header and body to be separated by an empty line.
We require header lines to end with a newline. m_getfld2() does
not try to guess as much as the old m_getfld() did.
markus schnalke [Wed, 28 Oct 2015 22:19:14 +0000 (23:19 +0100)]
Build the release tarball from git, not manually
Previously the Makefiles contained lists of files to distribute.
They built the release tarball manually. It's much easier to just
use git, which knows which files are the relevant files, because
it's the ones that are under version control. We just need to
add some additional, pre-generated files for convenience, so that
the user does not need to have auto* and lex installed.
The release tarball is now fully assembled in the top-level
Makefile. (The only tricky part is sbr/dtimep.c, because that
needs to be generated in the subdirectory.)
markus schnalke [Wed, 28 Oct 2015 16:50:24 +0000 (17:50 +0100)]
Include `test' dir in release tarball
The subdirectories `docs' and `test' are managed by the top-level
Makefile now, because there's nothing to do in them but to copy
them for the distribution tarball. (This way, we also don't have
to include each new file in these directories to the file list in
Makefile.in.)
markus schnalke [Tue, 27 Oct 2015 06:43:58 +0000 (07:43 +0100)]
Ensure $SHELL is set for the tests
Non-interactive shells might not set it (this is true for dash
and mksh, at least). Currently we use $SHELL in whatnow(1).
Although we likely remove this use, it's rather worthwhile to
have $SHELL available in the test scripts.
markus schnalke [Mon, 26 Oct 2015 07:04:55 +0000 (08:04 +0100)]
Update TODO list
Some comments on the removed items:
- Mmh's show does already invoke a pager
- The reverse action of `rmm' is: refile -src +trash l @
- Disjunct contexts are already possible (just set MMHC accordingly)
- We already generate the mh-chart man page
- Prompter can already be used to input the recipients. Use:
Editor: prompter
prompter: -nobody
prompter-next: vi
- Comp: -nowhatnowproc is obsolete; use `-whatnowproc true' instead.
(It puts an empty draft into the drafts folder.)
- Forw: Since we use MIME to forward messages, these todos are obsolete
- Mhmail is not considered to be a full-featured interface to MH
- We now do have RFC 2047 encoding of headers
markus schnalke [Sun, 25 Oct 2015 20:34:20 +0000 (21:34 +0100)]
send: MIMEify with non-ascii header and ascii body!
This code is not perfect, as it scans body lines twice. We might
want to rework it someday. But, ignoring the minor performance
issue, it ensures, that we MIMEify in the case when some headers
contain non-ASCII text but the body does not.
markus schnalke [Fri, 23 Oct 2015 07:52:55 +0000 (09:52 +0200)]
Fix off-by-one error (CPERLIN)
CPERLIN is the chars per line without the line break chars (\r\n),
at least would that match the description in RFC 2822. Actually,
however, the max SHOULD line length (excluding line break chars)
is 78 according to the RFC. Therefore it seems as if we should
set CPERLIN to 78. (This is open to decide and to do.)
markus schnalke [Wed, 21 Oct 2015 15:35:14 +0000 (17:35 +0200)]
Coding style adjustments for nmh-imported code
- No documentation in h/prototypes.h, but rather in the sbr/*.c files
- Convert coding style from nmh to mmh:
+ indent with tabs only not with a tab-spaces-mixture
+ no space between function name and opening parenthesis
+ no space on the inner side of parens
+ no trailing space
+ different comment style
- Variable definition at the beginning of the block only (ANSI C)
- Choose meaningful identifier name rather than add a comment to a
meaningless name
markus schnalke [Fri, 2 Oct 2015 17:49:38 +0000 (19:49 +0200)]
mhbuild: Avoid a dot on a line on its own
mhbuild's quoted-printable encoder breaks lines to have at most
CPERLIN chars. If the it happens that the last character on the
line is a dot (`.') and the line is broken just before it, then
the following line contains nothing but one single dot. This
currently leads to problems in mmh ... but it may cause problems
to other mail software as well. Hence we avoid it by encoding
any dot at the beginning of a line, just to be sure.