Is it mail that you're building (with attachments to messages), or a messaging platform? Not necessarily instant messaging, but say, the type of inter-user messaging on phpBB forums.
You may have some luck with looking for a messaging library of some kind, instead of a mail platform. Not too email based, not too IM based, and not too social.
Instead of paring down phpBB, something like discourse may be easier to pare down, or fit outright. https://www.discourse.org/
Still, if I was looking for a github project that was very clean and simple.. it might be a one table message queue solution for this, where it has date-time/from/to/content/status columns, I'd almost wonder if it wouldn't be quicker just to implement than to find something and integrate.
If there's any chance the messaging functionality had to grow, I'd try to find an xmpp based messaging library that had a message store in it instead of IM - this would give me a migration/upgrade path to other features, and standardize if needed.