If you are using IMAP, I don't believe you need to manually copy emails from one computer to another. Just set up the IMAP account on your new computer and when you connect to the server, all your emails will be there. Under IMAP, emails are stored on the server, not your local machine. That's why you can have multiple devices (Mac, iPhone, iPad, PC, etc.) all connect to the same email account and your emails will always be in sync on all devices.
There are exceptions, of course; if you moved or saved any emails to "On My Mac" then that's where they live and you would need to manually transfer them.