* lisp/gnus/nnimap.el (nnimap--split-download-body): New variable.
(nnimap-fetch-inbox): Use it in conjunction with
nnimap-split-download-body.
* lisp/gnus/spam.el: Don't load nnimap.el at compile time for a
dynamic variable.
(spam-setup-widening): Rather than unconditionally set user option
nnimap-split-download-body, set nnimap--split-download-body to a
unique non-nil value only if the variable was nil (bug#44981).
(spam-teardown-widening): New function that undoes this if
nnimap--split-download-body still holds the unique value.
(spam-unload-hook): Call spam-teardown-widening to revert any change
to the value of nnimap--split-download-body.