It might be easier to use Importing mailing lists (mbox, Listserv, Google Groups, emails, ...) to import data from Yahoo Groups. Either by using mbox files or maybe by converting the JSON files you mentioned into individual MSG files containing the raw email text.
The mbox import script handles mbox files as well as emails stored in individual files and it might already have solved all the problems you are encountering right now.