Baby POP3 Server is a standard, simplified POP3 server, taking up little resources and supporting almost every featuire of a conventional POP3 server
POP3 Server classes:
CListenSocket
This socket accepts all incoming connections. When a client connects to the server, CListenSocket accepts the connection and creates a new thread (CClientThread) that will take care of all further communication between the client and the server. After the thread has been created, CListenSocket will return to its waiting state.
CClientThread
This thread will handle all communication between the client and the server using CControlSocket.
CControlSocket
This socket class will process all incoming POP3 commands and send back the response to the client. CControlSocket is basically the class where all the 'good stuff' is happening:
Validate user login
Read mail directory and keep track of changes (deleting mail).
When requested, send messages to the client.
CMonitorThread
This thread monitors the mail drop folder for incoming messages (from the SMTP server). When a new message is dropped into this folder, it's header will be checked to determine the receiver. If this receiver has a user account on our server the messages will be copied to his/her mailbox. If the server can't determine the receiver, the messages will be moved to the admin mailbox.
CMonitorThread uses FindFirstChangeNotification to find out if there are any new messages in the mail drop folder. Unfortunately ReadDirectoryChangesW is not available under all versions of Windows(this function tells us exactly what has changed in the specified directory) , so I had to reproduce it's functionality by keeping track of the changes myself.
Configuration:
To make this POP3 server useful you must also have a SMTP server installed. Microsoft's SMTP server from ISS will be fine (included with Windows NT/2000/XP). Usually this SMTP will have a mail drop folder were it will drop incoming messages. Microsoft's SMTP server uses c:inetpubmailrootdrop by default.
This mail drop folder is the input folder for our POP3 server, so open the Settings dialog and set the mail folder.
The time-out setting let's you specify the time-out value for receiving data. When clients become idle for too long the connection will be closed.
In User Accounts you can Add/Edit and Delete user accounts. The admin account is default and can't be removed.
TODO:
Implement any missing commands.
Add mailbox locking (so multiple users can't log into the same mailbox).
Add domain checking.
Make lots of money by selling this software instead of giving it away for free
Here are some key features of "Baby POP3 Server":
· Supports most RFC1939 POP3 commands
· Supports multiple POP3 user accounts
· Integration with Microsoft SMTP server
· Multi threaded