convert text part to binary when we can not decode

If we couldn't find or guess charset or if charset
is not supported or failed to parse properly then
RT was dropping email.

Now instead of dropping we set content type to
'application/octet-stream' and save original value
to X-RT-Original-Content-Type header. In this
case users can download part and deal with it.

In most cases it would be related to spam, but
there are valid charsets that are not supported
by Encode module.
test ?Q? header encoding with not supported charset
Merge branch '4.0/encoded-word-whitespace' into 4.0/unknown-email-charset
handle not supported charsets in Q/B encoded words

There is no good way to save original content. We
preserve only printable ascii characters, everything
else replaced with \x{FFFD} unicode code point.
Avoid warnings with undef $From
show how hash/array/code arguments passing fails
fix passing arrays, hashes and code into templates

It was always intention to make XXX => [...] arguments
to $template->Parse method to be available in template's
code as @XXX, but it was broken.

This is a fix, not a backwards incompatible change, as we
have GnuPG errors notification templates that rely on
such behavior.
Improve logging for failed sender parsing in email

Starting with version 1.893, Email::Address returns undef
if passed non-ASCII email addresses to parse.

Track such email parsing failures in ParseSenderAddressFromHead and
pass them back as an optional third parameter. This allows the
caller to report the error if desired. Failure to parse one message
will generate an error, but the function can still find and return
a valid address from another header. This function is
called from several places and returning the error rather than reporting
avoids multiple warnings from parsing the same emails.

ParseSenderAddressFromHead still reports a failure to find a sender
in any header, since that is an error. That message will be reported
multiple times, one for each call to the function.

Update MailFrom.pm's GetCurrentUser to report the parse failures
as a warning. These parse failures are reported even if a sender
was found in another header. Also update the existing error in
GetCurrentUser to indicate that a parsing failure can also
prevent finding a valid sender.
Skip writing DatabaseAdmin and DatabaseAdminPassword keys
Make ordering of written config keys consistent, at least
add bookmark star on ticket list and display pages for mobile ui
Adding approvals docs to core documentation.
Factor out Outlook/Exchange detection
Improve logging of Outlook cleanup slightly
Outlook mails with doubled newlines append whitespace as well; trim it
Move outlook detection to after decoding, for base64'd content

Single-part messages in base64 encoding have been observed in the wild
with this failure mode, in addition to the multipart/alternative
messages already dealt with.  Enable double-newline-stripping on all
Outlook/Exchange single-part base64'd mail; this requires moving the
cleanup stage until after decoding has happened, such that the decoded
bodies can be altered.
Include the Mason stack trace when logging Mason exceptions

The one-line error message provided by ->full_message is fairly useless
without a stack trace since RT->Logger reports only the location it was
called from.  Unlike RT's $LogStackTraces option, Mason provides a
nicely filtered and formatted stack which includes component names.
Ignore symlinks in the testing tree when using get_relocatable_dir/file()

Parent directory traversals (C<..> or File::Spec->updir()) are naively
canonicalized based on the test file path (C<$0>) so that symlinks
aren't followed.  This is the exact opposite behaviour of most
filesystems and is considered "wrong", however it is necessary for some
subsets of tests which are symlinked into the testing tree.
Make ValidateWebConfig account for proxied hosts

Many reverse proxies alter the headers that they pass through to the
backend server, which causes spurious warnings from ValidateWebConfig.
For example, while WebDomain is set up to point to the name of the
reverse proxy host, the Host: header that is received (from the proxy)
is the name of the back-end server.

Look at the pre-proxied header values, when they exist, to determine if
WebPort and WebDomain are configured correctly.  Also consolidate the
two separate WebDomain checks, for clarity.
stop RT from locking on "large" mails

Recent improvement in search for GnuPG encrypted/signed parts
introduced a deadlock situation. Happens on mail delivery with
GnuPG enabled and the mail containing a "large" quoted printable
or base64 encoded part. Size depends on OS and system
configuration. Symptoms: web server process hangs doing nothing,
rt-mailgate times out, no messages in logs.

It is incorrect use of pipe inside one process. After some ammount
of data, Writer just blocks waiting for reader to fetch it.

The commit in question is 258ec2fb531c83df00afae3f428975b9871e1f68
that was included into 3.8.15 and 4.0.8rc1.