First some background from here
[In 1997, there was a significant controversy when] Dr Marc Shapiro
published an article called Scholars and Friends: R' Yechiel Ya'akov
Weinberg and Prof. Samuel Atlas. The piece included private
correspondence between the Seridei Esh (R Weinberg) and his friend
Prof. Samuel Atlas of Hebrew Union College. A lot of people were upset
that this private correspondence was published, both because of what
it was in itself: letters between a גדול and his friend who was a
professor at a Reform university, but also because of the content of
those letters. Of course other people felt that this is the truth, and
the truth is not upsetting, but just true.
In the next volume, journal editor R Dr. J.J. Schachter published
a piece called Facing the Truths of History in which he basically
questioned his decision to publish Shapiro's article, but also
Starting on p. 242 R Schachter discusses the herem of R Gershom and specifically various caveats that would enable one to publish letters. See the full article for details but here is a summary of some of the caveats
some formulations of the original herem are phrased "if [the recipient] threw away the letter it is permitted [to read it]"
R Hayim Palaggi states the herem only applies if the letter includes a prohibition to further broadcast it
R Moshe ben Habib felt the sender needed in addition to verbally articulate that the herem applies to his letter, in addition he felt the herem applied only to the one opening the letter, not to one who reads an already opened one -- and so write the Shiltei ha-Gibborim and the Birkei Yosef
on p. 245, R Schachter brings arguments showing the herem wouldn't apply to a deceased person
He concludes by writing
Finally, my most significant proof for the inapplicability of this
herem to our context and the permissibility of generally printing
divrei Torah after their author’s death is simply ma‘aseh rav.
Significant precedent is, indeed, available for both these activities.
What is the essential content of Torah journals like Moriah and Kerem
Shlomoh, for example, and countless memorial volumes for deceased
gedolim if not precisely this, publishing private letters and divrei
Torah of gedolei Yisrael after their deaths when neither they nor
members of their family are available to grant permission?
Furthermore, dozens of collections of letters of gedolei
Yisrael—including much personal material as well—have been published