Do you actually need to do anything?
If the e-mail accounts are IMAP, then the mail all lives on the server anyway, and local copies on any individual client are disposable.
A new client will pick them up from the server.
If you are still using POP3, then the mail will only be on the client and that's harder.
In this case, I'd see it as the time to migrate to IMAP, and set up a new IMAP account.
Configure the old machine to see the IMAP account.
Copy the local messages to the IMAP folders.
Then continue as normal, configure the new machine for the IMAP account.