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.
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
following.
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.
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.
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.
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.
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.
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 <meillo@marmaro.de>'') in aliases. The helper
tool ap(1) is used to extract the actual addresses.
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
done
# 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 @
done
# 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.
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:
%(void{comp})%(trim)%(putstr)
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.
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.
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'.
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
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.
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.
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.