4 years agomhsign manpage: mention hostname bug [Thu, 5 Jan 2017 15:35:22 +0000 (08:35 -0700)]
mhsign manpage: mention hostname bug

4 years agowhatnow2: remove get_attachmentheader()
Dmitry Bogatov [Fri, 16 Sep 2016 12:22:28 +0000 (15:22 +0300)]
whatnow2: remove get_attachmentheader()

4 years agoRemove unused code
Dmitry Bogatov [Thu, 8 Sep 2016 10:03:52 +0000 (13:03 +0300)]
Remove unused code

The unsude code is: struct zone, macro strbase64, macro isatom,
function unset_unseen(), function pref_encoding(), function cpydgst(),
macro base64len

4 years agoGrammer and layout fixes anno.man1
Larry Hynes [Tue, 13 Dec 2016 20:14:12 +0000 (20:14 +0000)]
Grammer and layout fixes anno.man1

4 years agoGrammer and layout fixes in ali.man1
Larry Hynes [Tue, 13 Dec 2016 20:14:12 +0000 (20:14 +0000)]
Grammer and layout fixes in ali.man1

4 years agofix bug in whatnow2 attach
Philipp Takacs [Sun, 25 Sep 2016 20:40:46 +0000 (22:40 +0200)]
fix bug in whatnow2 attach

5 years agoredesign version string
Philipp Takacs [Sun, 4 Sep 2016 12:12:00 +0000 (14:12 +0200)]
redesign version string

Now we have two version nummbers one for the tool
and one for the lib. Also the version number is changed
everytime the object is rebuild.

5 years agoFix segfault in mhstore
markus schnalke [Mon, 12 Sep 2016 12:54:17 +0000 (14:54 +0200)]
Fix segfault in mhstore

The bug was introduced by 6306992cd580d47c217edb1ae98d58b24d5be8c9
It didn't handle MIME parts without Content-Disposition headers.

5 years agoFix repllistcomps: use the correct header
markus schnalke [Thu, 8 Sep 2016 06:54:52 +0000 (08:54 +0200)]
Fix repllistcomps: use the correct header

5 years agoNo need to define the month and day names a second time
markus schnalke [Wed, 7 Sep 2016 20:59:21 +0000 (22:59 +0200)]
No need to define the month and day names a second time

... just use the definition that already is available.

5 years agoAdd support for simplified ISO 8601/RFC 3339 dates
markus schnalke [Wed, 7 Sep 2016 20:41:06 +0000 (22:41 +0200)]
Add support for simplified ISO 8601/RFC 3339 dates

It is now possible to use:
pick -after 2016-02-15 -and -before 2016-08-31T16:30:00+02:00

At the same time drop support for the highly ambiguous date format

5 years agoReplace lookup tables for obscure hashes with more readable code
markus schnalke [Wed, 7 Sep 2016 14:31:58 +0000 (16:31 +0200)]
Replace lookup tables for obscure hashes with more readable code

Time-performance doesn't matter here. If you think differently,
demonstrate it convincingly!

5 years agoRemove not used code (JLR define)
markus schnalke [Wed, 7 Sep 2016 05:52:38 +0000 (07:52 +0200)]
Remove not used code (JLR define)

I don't yet understand what the code does but we've never used
it and didn't miss it, thus it appears to be a good decision to
just remove it.

5 years agofix build in a diffrent folder
Philipp Takacs [Tue, 6 Sep 2016 23:14:42 +0000 (01:14 +0200)]
fix build in a diffrent folder

Build in diffrent folder is a feature required by
the test suite.

This is a fixup for commit 94ac6bb

5 years agoFactor trim format function out
markus schnalke [Tue, 6 Sep 2016 18:10:28 +0000 (20:10 +0200)]
Factor trim format function out

Also clarify that it trims both, leading and trailing whitespace.

(Note that it is a special trim function. We cannot simply replace
it with sbr/trim.c. Nonetheless, its readability is somehow bad.)

5 years agoAdd %(unmailto) format function for List-Post headers
markus schnalke [Tue, 6 Sep 2016 17:53:20 +0000 (19:53 +0200)]
Add %(unmailto) format function for List-Post headers

With the unmailto format function it is possible to extract
the address from a List-Post header, which e.g. is:
List-Post: <>
Applying  %(unmailto{list-post})  extracts: ``'',
which then can be used as recipient address for list replies.
A format file (to be used with ``repl -form repllistcomps'')
is included.

5 years agoGenerate the command list in mmh-intro(7)
markus schnalke [Tue, 6 Sep 2016 05:58:17 +0000 (07:58 +0200)]
Generate the command list in mmh-intro(7)

This implementation does handle the aliases of folder(1) and
flist(1), but not the ones of show(1) and new(1). Hence the
commands next(1), prev(1), fnext(1), fprev(1) and unseen(1)
don't appear on the list.

Adjusted some of the short descriptions based on the version
in the manual command list.

5 years agoMake mhstore(1) use "filename" attr of Content-Disposition
markus schnalke [Mon, 5 Sep 2016 09:51:00 +0000 (11:51 +0200)]
Make mhstore(1) use "filename" attr of Content-Disposition

Before, only the "name" attr of Content-Type was used as the filename
to store attachments. The "filename" attr of Content-Disposition
(which is the much more appropriate value) was ignored, thus often
resulting in the attachment being stored with a default name like
20.2.pdf, for instance.

5 years agoremove msg-hook config option
Philipp Takacs [Wed, 31 Aug 2016 15:21:15 +0000 (17:21 +0200)]
remove msg-hook config option

This is removed, because I don't see this is necesarry and it's
not a good idea to pass a user provided string direct in a
format string.

5 years agoFix unreproducible build
Dmitry Bogatov [Mon, 29 Aug 2016 23:35:43 +0000 (02:35 +0300)]
Fix unreproducible build

Hostname and date of compilation are no longer embeded in version
string. See

5 years agoFix spelling errors, including binaries ones
Dmitry Bogatov [Sat, 27 Aug 2016 08:06:00 +0000 (11:06 +0300)]
Fix spelling errors, including binaries ones

Signed-off-by: Dmitry Bogatov <>

5 years agoFix missing va_end call in uip/mhmisc.c
Dmitry Bogatov [Sat, 27 Aug 2016 08:40:15 +0000 (11:40 +0300)]
Fix missing va_end call in uip/mhmisc.c

5 years agoFix misspelled variable in uip/
Philipp Takacs [Sat, 27 Aug 2016 21:17:35 +0000 (23:17 +0200)]
Fix misspelled variable in uip/

This make the error message better

5 years agoFix out-of-bounds error when incorporating email from stdin
Dmitry Bogatov [Fri, 26 Aug 2016 23:03:28 +0000 (02:03 +0300)]
Fix out-of-bounds error when incorporating email from stdin

Before this patch, if +inbox is empty, following error happened:

$ inc -file - < /dev/null

Incorporating new mail into inbox...

inc: no messages incorporated, continuing...
inc: Bug: message out of bounds

This happened due improper call to `seq_setunseen', which implicitly
assumed that there is at least one message (it does not handle case
where both mp->hghmsg and mh->lowmsg are 0).

Bug does not happens with command `inc -file empty', since file
is checked for being empty before any read attempts.

Signed-off-by: Dmitry Bogatov <>

5 years agoFix FILE resource leaks in uip/distsbr.c
Dmitry Bogatov [Sat, 27 Aug 2016 08:37:28 +0000 (11:37 +0300)]
Fix FILE resource leaks in uip/distsbr.c

5 years agoadd Sendmail option to spost manpage
Philipp Takacs [Wed, 24 Aug 2016 12:46:26 +0000 (14:46 +0200)]
add Sendmail option to spost manpage

Thanks Dmitry Bogatov

5 years agoadd uip/whatnow2 to .gitignore
Philipp Takacs [Tue, 23 Aug 2016 15:04:12 +0000 (17:04 +0200)]
add uip/whatnow2 to .gitignore

5 years agoBump version number
Philipp Takacs [Sun, 14 Aug 2016 22:35:23 +0000 (00:35 +0200)]
Bump version number

5 years agoThis is mmh-0.3 mmh-0.3
Philipp Takacs [Sun, 14 Aug 2016 22:21:12 +0000 (00:21 +0200)]
This is mmh-0.3

5 years agofix whatnow2 send
Philipp Takacs [Sun, 14 Aug 2016 22:11:39 +0000 (00:11 +0200)]
fix whatnow2 send

in the last commit whatnow2 send was changed
to keep the metafile. This don't work with the
``exec send''. Now the send() is renamed to
sendfunktion and the ``exec'' is removed.

5 years agodel metafile in whatnow2 only if send don't fail
Philipp Takacs [Sun, 14 Aug 2016 20:36:55 +0000 (22:36 +0200)]
del metafile in whatnow2 only if send don't fail

If send fails, you want to keep the metafile. Without this dist wold
only work, if send works on the first time. Also some metainfo don't
get lost.

5 years agotouch the DISTINCLUDE in mmhdist target
Philipp Takacs [Sun, 14 Aug 2016 15:31:50 +0000 (17:31 +0200)]
touch the DISTINCLUDE in mmhdist target

This avoids rebuilding this files. So autoconf and flex
is not need for a normal user.

5 years agoAdd "delete" to "delete" pattern in whatnow2's case construct [Fri, 12 Aug 2016 16:00:05 +0000 (09:00 -0700)]
Add "delete" to "delete" pattern in whatnow2's case construct

The attached patch modifies whatnow2 so that calling `whatnow2 delete`
works as may be expected.  Without this change, the "delete" function
in whatnow2 was called only when whatnow2 was executed as one of the

* whatnow2 del
* whatnow2 dele
* whatnow2 delet

5 years agobetter error handling in whatnow2
Philipp Takacs [Fri, 12 Aug 2016 16:11:11 +0000 (18:11 +0200)]
better error handling in whatnow2

if the command is unknown then usage is printed and if usage is
called with an argument other then 0 exit 1 is forced.

5 years agofix bug in decode_rfc2047()
Philipp Takacs [Fri, 12 Aug 2016 15:43:05 +0000 (17:43 +0200)]
fix bug in decode_rfc2047()

If iconv() returns an error and the source encoding
is utf-8, the character jump has an of by one: the
source string is incresed by one possition more the
the length is decreased.

5 years agoUpdate comment in script concerning the VCS
markus schnalke [Fri, 12 Aug 2016 08:07:07 +0000 (10:07 +0200)]
Update comment in script concerning the VCS

We're not using CVS anymore, but a VCS -- doesn't matter which one.

5 years agofix dist
Philipp Takacs [Thu, 11 Aug 2016 15:22:49 +0000 (17:22 +0200)]
fix dist

Because of always mimeify the dist hasn't work anymore.
This is fixed by skipping attach() and signandenc(), if
it's handled as a redistribution message.

5 years agoAdd more tests to tests/test-send-mimeify
markus schnalke [Wed, 10 Aug 2016 17:25:53 +0000 (19:25 +0200)]
Add more tests to tests/test-send-mimeify

5 years agoFix typo in whatnow2 function "display" [Mon, 8 Aug 2016 23:14:50 +0000 (16:14 -0700)]
Fix typo in whatnow2 function "display"

The attached patch fixes a typo in the whatnow2's "display" function.
[ -z instand of [ -n for a check if a variable is empty.

5 years agoadd a test for repl on a ASCII only system
Philipp Takacs [Sun, 7 Aug 2016 19:57:30 +0000 (21:57 +0200)]
add a test for repl on a ASCII only system

This should create the same output as with utf-8.
But the Umlaut should be displayed as '?'. This isn't
the case at the moment.

5 years agoFix typo in [Sat, 6 Aug 2016 21:13:18 +0000 (14:13 -0700)]
Fix typo in

command call is done with `command` not "command"

5 years agoTest if MIME creation works
Philipp Takacs [Sat, 6 Aug 2016 16:08:58 +0000 (18:08 +0200)]
Test if MIME creation works

Test if send uses mhbuild only, if it is usefull. A message
already in MIME-Formate should not cause a fail.

5 years agounset MM_CHARSET in tests/scan/test-scan-multibyte
Philipp Takacs [Sat, 6 Aug 2016 15:07:11 +0000 (17:07 +0200)]
unset MM_CHARSET in tests/scan/test-scan-multibyte

If MM_CHARSET is set to anything other then ascii this
test probaly fail, but the test is mean to run on a ascii
only envirement.

5 years agoAdjust tests/bad-input/test-header for m_gefld2()
Philipp Takacs [Sat, 6 Aug 2016 15:05:57 +0000 (17:05 +0200)]
Adjust tests/bad-input/test-header for m_gefld2()

With the m_gefld2 change mmh ignores more errors. This causes
a diffrent behaviour in some cases.

5 years agoFix tests/mhparam/test-mhparam [Fri, 5 Aug 2016 02:15:42 +0000 (19:15 -0700)]
Fix tests/mhparam/test-mhparam

The behaviour of readconfig() has changed. This causes
another behaviour for mhparam.

5 years agosend: Always MIMEify and pass already MIMIfied drafts through
markus schnalke [Fri, 5 Aug 2016 19:46:55 +0000 (21:46 +0200)]
send: Always MIMEify and pass already MIMIfied drafts through

Even if technically not necessary, MIMEify the draft. This simplifies
the code at hardly any cost.

To still be able to create arbitrary complex MIME structures, make
send(1) pass already MIMEified drafts through, without automatically
invoking mhbuild(1) on them a second time (which would fail). This
way, you can manually invoke mhbuild(1) and afterward call send(1)
... and everything will work just as expected.

Also documented this in the man page, and additionally added a
paragraph about the signing and encrypting feature of send(1), which
wasn't documented yet.

5 years agomhsign should work now
Philipp Takacs [Mon, 1 Aug 2016 11:14:47 +0000 (13:14 +0200)]
mhsign should work now

5 years agoAllow send(1) to send from folder other than +drafts
markus schnalke [Fri, 29 Jul 2016 09:18:36 +0000 (11:18 +0200)]
Allow send(1) to send from folder other than +drafts

This allows having multiple draft folders or queueing drafts
for automatic sending.

5 years agosome small fixes for
Philipp Takacs [Sat, 30 Jul 2016 22:05:05 +0000 (00:05 +0200)]
some small fixes for

some bugs fixes most found by markus

5 years agoEnable inc(1) to read from stdin [Mon, 1 Aug 2016 09:25:57 +0000 (11:25 +0200)]
Enable inc(1) to read from stdin

The -file switch handles the argument "-" special and reads
from stdin in this case.

5 years agoadd my whatnow replacement whatnow2
Philipp Takacs [Sat, 27 Feb 2016 18:58:42 +0000 (19:58 +0100)]
add my whatnow replacement whatnow2

whatnow2 is tool which acts like whatnow, but
don't trap the user in it.

5 years agomhsign/mhpgp: Clarify the manpages and usage lines
markus schnalke [Fri, 29 Jul 2016 09:42:59 +0000 (11:42 +0200)]
mhsign/mhpgp: Clarify the manpages and usage lines

These tools are shell scripts and thus have a different option
processing mechanism than the other mmh tools. Unfortunately, it
is limited: Options must come first.

Also note that mhpgp accepts a +folder argument, and what the
defaults are.

5 years agoUpdate manpages send(1) and mh-draft(7)
markus schnalke [Thu, 28 Jul 2016 22:28:58 +0000 (00:28 +0200)]
Update manpages send(1) and mh-draft(7)

Documented the actual behavior and homogenized the style.

5 years agoRemove extra space from 'From' line when writing to mbox
Vasily Kolobkov [Thu, 9 Jun 2016 12:30:30 +0000 (14:30 +0200)]
Remove extra space from 'From' line when writing to mbox

5 years agoFix header lookup table setup in slocal(1)
Vasily Kolobkov [Sun, 5 Jun 2016 22:08:14 +0000 (00:08 +0200)]
Fix header lookup table setup in slocal(1)

5 years agosimplify whatnow.c/main() function
Dmitry Bogatov [Thu, 14 Jul 2016 22:39:37 +0000 (01:39 +0300)]
simplify whatnow.c/main() function

GNU Complexity: 60 -> 59.

5 years agouse old error message
Philipp Takacs [Sun, 8 May 2016 16:40:51 +0000 (18:40 +0200)]
use old error message

5 years agodon't warn if lenerr is ignored
Philipp Takacs [Sun, 8 May 2016 16:21:34 +0000 (18:21 +0200)]
don't warn if lenerr is ignored

5 years agobetter error handling
Philipp Takacs [Mon, 25 Apr 2016 14:19:54 +0000 (16:19 +0200)]
better error handling

only warn for LENERR2, or ignore it in some cases

5 years agofork in repl as a tree
Philipp Takacs [Wed, 16 Mar 2016 02:06:03 +0000 (03:06 +0100)]
fork in repl as a tree

This fix the bug in the last improvement (pipe mail through show).
In the first patch repl only waits for one child, now the tree causes
that both childs finished befor repl continues.

5 years agofix 2fb1dd2271e5be9d0b0c9cbd4e7d6d5d51aaecb9
Philipp Takacs [Sun, 24 Apr 2016 12:19:05 +0000 (14:19 +0200)]
fix 2fb1dd2271e5be9d0b0c9cbd4e7d6d5d51aaecb9

Do a length check in the header, but not in the body.

5 years agofixup for 2a903a43ad7d26f5581d4ad1bbc077f8ecc5f5a9
Philipp Takacs [Sun, 24 Apr 2016 10:39:30 +0000 (12:39 +0200)]
fixup for 2a903a43ad7d26f5581d4ad1bbc077f8ecc5f5a9

a spell error hapend in uip/spost.c: state not status

5 years agocheck for to long lines and ioerror in spost
Philipp Takacs [Sun, 24 Apr 2016 10:29:32 +0000 (12:29 +0200)]
check for to long lines and ioerror in spost

Now spost stop and exit if some error happend. Befor this
spost stoped on an error in the body and submitted a half

5 years agocheck for linecap and trailing space in mhbuild for text/plain
Philipp Takacs [Sat, 23 Apr 2016 18:50:43 +0000 (20:50 +0200)]
check for linecap and trailing space in mhbuild for text/plain

without this a mail with too long lines can be created, or
trailing space is removed by mhsign.

5 years agoignore LENERR2 in seq_read()
Philipp Takacs [Sat, 23 Apr 2016 18:48:45 +0000 (20:48 +0200)]
ignore LENERR2 in seq_read()

this is unnecessary and brings problems because
sequences aren't created with a linecap.

5 years agoadjust handling of too long lines in m_getfld2
Philipp Takacs [Sat, 23 Apr 2016 18:46:20 +0000 (20:46 +0200)]
adjust handling of too long lines in m_getfld2

Now a field is complete read, if a line is to long.
Also no length check is done in the body, because
the caller can check f.valuelength.

5 years agoFix for commit bd02210b2be64956a952f925a2dcd35fb42f6136
markus schnalke [Sun, 24 Apr 2016 08:59:10 +0000 (10:59 +0200)]
Fix for commit bd02210b2be64956a952f925a2dcd35fb42f6136

5 years agoMerge branch 'm_getfld2-meillo' into master
Philipp Takacs [Fri, 22 Apr 2016 22:56:56 +0000 (00:56 +0200)]
Merge branch 'm_getfld2-meillo' into master

5 years agomhsign: Fix key lookup of aliases when encrypting
markus schnalke [Fri, 22 Apr 2016 10:46:33 +0000 (12:46 +0200)]
mhsign: Fix key lookup of aliases when encrypting

Now mhsign can handle addresses that contain whitespace (e.g.
``markus schnalke <>'') in aliases. The helper
tool ap(1) is used to extract the actual addresses.

5 years agorefile: Never change the current folder
markus schnalke [Thu, 21 Apr 2016 14:43:25 +0000 (16:43 +0200)]
refile: Never change the current folder

Refile is different to all other tools, as its +folder arguments
are destination folders, not source folders (it even supports
multiple of them). A source folder can be specified with -src.
Refile used to change the current folder to the source folder.
It does not do so anymore.

Most often the current folder is used as the source folder; this is
the default. Hence changing the current folder is a no-op. But if
one refiles from some other source folder, changing to that folder
is seldom useful. Consider the scenario where one wants to collect
the last messages of a set of folders in some other folder. The
old behavior required to know where you are to collect the messages,
because after the first refile you'd be somewhere else:

for i in one two three ; do
refile -src +$i l +lastmsgs
# now we are in +three, hence go back where we were
folder +lastmsgs

The new behavior allows to move the messages just here (@), no
matter where that is:

for i in one two three ; do
refile -src +one l @
# now we still are where we were

Refiling actions do no more affect the current folder, hence one
may securely refile with different -src +folder many times in one
row, without having to care for changing locations.

5 years agorefile: Fix an error message; always use braces; add/remove comments
markus schnalke [Thu, 21 Apr 2016 14:03:23 +0000 (16:03 +0200)]
refile: Fix an error message; always use braces; add/remove comments

5 years agoFix order of (trim) and (decode) in repl*comps
markus schnalke [Wed, 20 Apr 2016 07:02:06 +0000 (09:02 +0200)]
Fix order of (trim) and (decode) in repl*comps

Before MH had (decode), the format escapes used to be:
i.e. set the internal str register to the component text, trim
trailing whitespace from it, then print the value. Later (putstr)
was simply replaced by (decode), which first RFC-2047 decodes the
string and then prints it (if it is the outermost function). That
almost always produced the correct result. But this way the
whitespace trimming is done at the wrong point. Correct is to first
decode the string and then trim it. tests/scan/test-mh-format
checks for that.

5 years agoTrim trailing whitespace in scan and show
markus schnalke [Wed, 20 Apr 2016 06:54:20 +0000 (08:54 +0200)]
Trim trailing whitespace in scan and show

This commit fixes the most common scan listings. Still trailing
whitespace will be generated by legacy scan listings.

The formatfield workaround in etc/mhl.headers is a bit clumsy.
Maybe, an mhl variable should be defined for this case ... or
better not, to keep the mh-format and the mhl functions orthogonal.

5 years agoMake default scan/inc listing file-based
markus schnalke [Wed, 20 Apr 2016 06:19:24 +0000 (08:19 +0200)]
Make default scan/inc listing file-based

There's now a new format file etc/scan.default, which contains
the default scan listing. Previously it was hard-coded as a define
in h/scansbr.h. The default scan listing format can be set in
config/config.h and can be queried with `mhparam scanformat'.

5 years agoCleanup manpage mh-format(5)
markus schnalke [Tue, 19 Apr 2016 14:15:10 +0000 (16:15 +0200)]
Cleanup manpage mh-format(5)

- More suitable scan listing examples
- Adjust paths
- There are no ``local mh experts'' anymore in the mmh world
- Add overview on the escape types
- %(decode) does print str as well
- Decode Subject header in the example
- Further minor stuff

5 years agoEnable addr decoding in replcomps and replgroupcomps
markus schnalke [Mon, 18 Apr 2016 07:13:15 +0000 (09:13 +0200)]
Enable addr decoding in replcomps and replgroupcomps

5 years agoTests: mmh currently generates a part line, so expect it
markus schnalke [Mon, 18 Apr 2016 06:47:17 +0000 (08:47 +0200)]
Tests: mmh currently generates a part line, so expect it

5 years agoFix spelling and encoding errors in manpages and an error message
Dmitry Bogatov [Wed, 13 Apr 2016 18:36:29 +0000 (21:36 +0300)]
Fix spelling and encoding errors in manpages and an error message

5 years agotest also libtinfo for modf
Jan Düpmeier [Wed, 13 Apr 2016 16:22:37 +0000 (18:22 +0200)]
test also libtinfo for modf

Some Gentoo instalations has this instand of ncurses

5 years agoReplace getcpy() and strdup() with mh_xstrdup() [Mon, 4 Apr 2016 04:33:34 +0000 (21:33 -0700)]
Replace getcpy() and strdup() with mh_xstrdup()

this harmonise the code.

Also fix some bugs, if return value of strdup is not checked.

5 years agosimple mbox support for rcvstore
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.

5 years agoReplace free() with mh_free0() [Tue, 22 Mar 2016 03:28:44 +0000 (20:28 -0700)]
Replace free() with mh_free0()

mh_free0() free's the memmory and set's the pointer to NULL after
the free. This avoids doublefree and dereferenc of a non valid poiter.

5 years agoremove unnecessary casts [Thu, 17 Mar 2016 15:16:26 +0000 (08:16 -0700)]
remove unnecessary casts

These casts after malloc just make the code harder to read

5 years agoReplace mh_xmalloc() with mh_xcalloc() [Mon, 14 Mar 2016 16:29:35 +0000 (09:29 -0700)]
Replace mh_xmalloc() with mh_xcalloc()

calloc() is safer, because it initialize the memory to zero.

5 years agoCall context_read() before getting filter in repl [Sun, 13 Mar 2016 15:49:35 +0000 (08:49 -0700)]
Call context_read() before getting filter in repl

The manual page of repl says "[i]f a file named `mhl.reply' exists in the
user's mmh directory, it will be used instead of [the default form file]".
Now this behavior is implement.

5 years agocheck return value of m_getfld2 befor using the field
Philipp Takacs [Sat, 27 Feb 2016 14:45:26 +0000 (15:45 +0100)]
check return value of m_getfld2 befor using the field

this bug causes a segfault, because the field.value is a
nullptr if FILEEOF2 is returned.

5 years agopipe mail throu show on repl
Philipp Takacs [Sun, 17 Jan 2016 13:19:11 +0000 (14:19 +0100)]
pipe mail throu show on repl

now repl works as expected for MIME-messages

5 years agoAdd existing "From:" to Bcc-ed messages. [Thu, 14 Jan 2016 21:41:26 +0000 (14:41 -0700)]
Add existing "From:" to Bcc-ed messages.

If you use multible mailboxes, the correct one is
now used for Bcc-messages.

5 years agofix profile path in mhl(1)
Philipp Takacs [Thu, 7 Jan 2016 13:23:34 +0000 (14:23 +0100)]
fix profile path in mhl(1)

5 years agoChange some "nmh" into "mmh" in man pages [Tue, 5 Jan 2016 02:47:00 +0000 (19:47 -0700)]
Change some "nmh" into "mmh" in man pages

This is to avoid confusion between nmh and mmh

5 years agoUse boolean instand of bool
Philipp Takacs [Sun, 13 Dec 2015 16:20:33 +0000 (17:20 +0100)]
Use boolean instand of bool

5 years agoRevert "add free_field as standard for struct field"
Philipp Takacs [Sun, 13 Dec 2015 16:14:38 +0000 (17:14 +0100)]
Revert "add free_field as standard for struct field"

This is not necesary, because the compieler have to take care
about NULL != (void*)0

This reverts commit a87df3543d3bc128ba4079d1f95638476ba5ca50.

5 years agofix lengthcheck in m_getfld2()
Philipp Takacs [Fri, 27 Nov 2015 10:59:03 +0000 (11:59 +0100)]
fix lengthcheck in m_getfld2()

The lenght check akcepted to big field names

5 years agofix segfault in prompter
Philipp Takacs [Fri, 27 Nov 2015 10:54:24 +0000 (11:54 +0100)]
fix segfault in prompter

This was necesary because m_getfld2() clears now f.value
if FILEEOF2 is reached

5 years agoadd free_field as standard for struct field
Philipp Takacs [Thu, 26 Nov 2015 22:24:18 +0000 (23:24 +0100)]
add free_field as standard for struct field

this is a easy way to initializ a struct field. ``{{0}}''
can lead to bugs, because NULL is not necesary ``((void *)0)''

5 years agom_getfld2 is more tranceparent on error
Philipp Takacs [Thu, 26 Nov 2015 22:07:12 +0000 (23:07 +0100)]
m_getfld2 is more tranceparent on error

now all read content of the file is given to the caller,
so he can possible fix this error.

5 years agomake m_getfld2() aware of CRLF lineendings
Philipp Takacs [Sat, 21 Nov 2015 11:20:36 +0000 (12:20 +0100)]
make m_getfld2() aware of CRLF lineendings

5 years agomake m_getfld2() called with an error state a noop
Philipp Takacs [Sat, 21 Nov 2015 11:16:01 +0000 (12:16 +0100)]
make m_getfld2() called with an error state a noop

This probduce some code dublication, but the will be
reduced, if we make m_getfld2() more transparent on errors.

5 years agoFinally we get rid of the unmaintainable m_getfld()!
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.

5 years agoAdjust tests to m_getfld2() and write some more
markus schnalke [Thu, 12 Nov 2015 19:58:03 +0000 (20:58 +0100)]
Adjust tests to m_getfld2() and write some more

m_getfld2() is more strict than m_getfld() and does less guessing.