After spending a couple of days looking at this and almost giving it up as 'too hard', I finally made a bit of progress:
All I have right now is a little 'mailserver' app which listens on the mailserver port specified in eqemu_config.xml and sends hardcoded responses to the client requests as a 'proof of concept', so plenty of work left to do to turn it into a working mail system.