Solutions

I finally found a solution to how to get raw emails with arbitrary, possibly modified headers, strange encodings, etc. into PopTrayU for testing, Test Catch-all Email Server, a java-based POP3 email server for windows and other platforms.

Finding the right POP3 server was tricky and took a lot of research and mis-starts. I kept finding programs that looked to complex to learn, poorly documented, unclear whether they could even solve my problem, ones that would require re-compiling with a bit of non-trivial modification, not to mention headaches of getting the configuration set up to even build… but once I found the right program, it turned into a breeze, and I didn’t have to edit any code at all.

Setting up test catch all mail server was as simple as described on their website:

  • Download and extract the latest release.
  • Open the mail.bat file and edit the JES_HOME variable to match the directory you installed the catch all server at.
  • Run mail.bat
  • All mail without a mailbox setup will be delivered to: The password for this mailbox is test.

By default it uses a flat-file store for the emails, so I just had to locate the /users/ folder and create a new text file with the same extension as the other files (.loc) which contains a single raw email I want on my mail server. I set poptrayu to download from localhost with the login, and it worked flawlessly.

Now I will be well on my way to creating a more comprehensive suite of test-cases and solving bigger more-important problems, like code-page encoding conversions causing an integer parse error.