Support "partitioned" GPG mail whose bodies are transfer-encoded

Most PGP clients do not put a Content-Transfer-Encoding on inline PGP
messages, as the content of the body is already base64 encoded.
However, some clients (or MTAs enroute) may elect to do so.  As
RT::EmailParser->ParseMIMEntity is passed Exact => 1, which forces
MIME::Parser->decode_bodies(0), ->open('r') thus gets the _undecoded_
body of the message, and searches for ---BEGIN PGP MESSAGE--- fail.

Temporarily pass the body through MIME::Decoder to undo transfer
encoding before checking for the PGP armoring in inline messages.
11231ea already ensures that the decoded body is used to the actual
decryption process later, once recognition has happened.
Fix sending email with 'perl-script' mod_perl handler and 'sendmailpipe'

ef35fe5 switched to using IPC::Open2 to communicate with the sendmail
process.  Unfortunately, due to the way it is implemented, IPC::Open2
assumes that the filehandle named STDIN is always on file descriptor 0;
if it is not, the child process does not recieve the expected pipe on
its FD 0, and mail fails to be sent.  This is manifest either as a
SIGPIPE when the parent attempts to read from their end of the pipe, or
an abnormal exit code if the child exits (noting it has no input) before
that.

Apache's mod_perl, when running under the 'perl-script' handler, not
only TIEs STDIN and STDOUT, as noted in d80b1e4, but also moves them to
not be on FD 0 and FD 1.  While RT 4.0 has moved to requiring the
'modperl' handler (for more or less this exact reason), RT 3.8 is not
prepared for such.

In order to ensure that IPC::Open2 works on all deployment options,
locally override STDIN to be on file descriptor 0, regardless of what FD
0 is currently being used for.
Merge branch '3.8/open2-fileno' into 3.8-trunk
Version bump for 3.8.13rc1
Protect both FD 0 and FD 1 on mod_perl to avoid sendmailpipe errors

Under the 'perl-script' handler on mod_perl, STDIN and STDOUT are
effectively moved out of the way before the body of the request is run,
such that they always appear to be closed in the handler.
Unfortunately, the way this was done on mod_perl <= 2.0.4 was to
actually close them, while storing away the handle in a higher FD for
later restoration.  This means that, after the completion of the first
request, FD 0 and FD 1 were left available for later system calls to
obtain, as STDIN and STDOUT crept into higher-numbered FDs.

While we explicitly opened FD 1 during the first request to protect
against this sort of issue, no such protection was given to FD 0.  This
allowed it to be claimed, in the second request, by the socket to the
browser.  This causes failures in 'sendmailpipe' communication, as we
are unable to dup STDIN onto FD 0 prior to calling IPC::Open2 (see
b7a5a53).  The symptoms of this in Apache's error log varied, but
included:

  Undefined value assigned to typeglob at RT/Interface/Email.pm line 459

  Apache2::RequestIO::rflush: (103) Software caused connection abort

  (9)Bad file descriptor: core_output_filter: writing data to the network

Though these errors were only observed under the prefork MPM, there is
no known reason that they could not occur under the worker MPM as well.

Resolve this by ensuring that we always claim both FD 0 and FD 1 during
the first request.  In doing so, we replace the possibly-brittle call to
open(), where we can only hope we get the FD we want, with
IO::Handle->new_from_fd(), which allows us to specify the FD we want.

mod_perl 2.0.5 resolved this issue by never actually closing STDIN and
STOUT, but rather local'ing them to be undef; this ensures that no later
system calls will obtain them accidentally.  Forcing them open using
new_from_fd, as this commit does, does not hurt matters, however.
Merge branch '3.8/protect-fd0' into 3.8.13-releng
Correct documentation to refer to @ReferrerWhitelist, not $ReferrerWhitelist
Version bump for 3.8.13rc2
Version bump for 3.8.13
Merge branch '3.8.13-releng' into 3.8-trunk
whitelist CalPopup page to make ie happy
Don't ask the interp object for the interp object

This corrects 82c9189f
We now look more like the 4.0 code in Dashboard/Mailer.pm
Merge branch '3.8/apply-escapes-rt-email-dashboards' into 3.8-trunk
Whitelist Search/{Results.html,Simple.html}

It's convenient to save or pass around links to search results rather
than needing to save and share and then load the saved search.
While there are potential issues here, it's much more user friendly
to allow it.
(cherry picked from commit 75a91cc3441fe1f71ea07d62a6dae4a5762b5562)
Merge branch '3.8/whitelist-search-results' into 3.8-trunk
Merge branch '3.8/csrf-whitelist-calpopup' into 3.8-trunk

Conflicts:
	lib/RT/Interface/Web.pm
Bump version for 3.8.14rc1
Merge branch '3.8/partitioned-gpg' into 3.8-trunk
Bump version for 3.8.14 release
Merge branch '3.8.14-releng' into 3.8-trunk