Thursday, August 31, 2006

Mail server design considerations

Creating a decent mail server is more difficult than it first appears. There are a number of issues which require consideration:
  • no mail that has been accepted should be lost if power is lost or the server is restarted
  • mail messages should never need to be kept fully in memory - they can reach many MB each
  • only one copy of each message should be stored on disc, regardless of number of recipients
  • the delivery of messages for remote hosts that cannot be delivered now (e.g. due to network problems) should be reattempted after a delay of a set number of minutes or hours
  • each message should get a unique id so it can be tracked by the administrator

Labels:

Monday, August 28, 2006

Kamaelia mail server

I have made a simple mail server for Kamaelia. Currently it can receive mail and store it but not forward it on. See /Sketches/RJL/SMTP/ in SVN.
The server's design follows the normal SimpleServer format except that each SMTPServer instance links itself to a shared QualityStorage component which handles saving messages (the 'quality' being that it confirms write-completition). A separate delivery component copies (hard links) messages into local mailboxes.



Mail server component topology

Mail server topology (when finished)


Labels: ,