Search code examples
unit-testingimappop3

POP3/IMAP server for unit testing


I'm looking for a simple POP3 and/or IMAP server for unit testing my application. Requirements are:

  • no root privileges required to make it fully functional,
  • may store it's data in whichever directory I choose,
  • compliant to RFCs,
  • possibility to add e-mails by hand.

I've tried Dovecot, but it seems too complicated and running it without special system account is fairly impossible.
I know Mozilla should have one for Thunderbird testing, but only one I have found was for newsgroups.


Solution

  • Why not use (or create) a mock server and use that to test the functionality? This will return the correct responses to the various commands so you can be sure that your code will work correctly when you connect it to a real server.

    That way you're not reliant on a 3rd party service for this aspect of your testing.