I’ve been redesigning some of the core elements of the message store and the way the IMAP server handles responses for the last week. In that time I think I’ve come up with some solutions to problems that I thought were inconveinces, but not really problems at the time.

After looking at the way I was starting the gen_server for the message store I started to realize that my configuration file was completely wrong. I had created a text file that had one command per line and needed to be parsed and fixed to be used. Default values were difficult and if the user excluded a mandatory line the server would crash :-)

I’ve now moved the default configuration into the .app file located in the ebin directory and the user can specify a .config file on the command line to override any settings they wish. I’ve also built in a function that lets me search for a key and define a default value if the key is not found.

This also lead me to look at how the processes were starting and stopping. Using appmon I found that the client connections were not being closed properly when the STMP QUIT the IMAP LOGOUT commands were issued. I’m not terminating the FSM properly when either of these commands are issued.

Originally I had the SMTP and IMAP servers started independently; now they are started by the erlmail app and there are configuration settings to determine if they are started by default or not.

I’m moving some of the logic from the modular message store into one place; erlmail_store.erl. This is a gen_server that will handle the message store functions and knows which module to call for specific functions. Each of the modular message store modules will have less logic in them; making them easier to create and the other ErlMail modules will call erlmail_store when they need to interact with the store. In the long run this means less redundant code and more control over how the modular message store components interact with the rest of the server.

The IMAP response server is in place and operating, but it now needs access to the message store and those features haven’t been developed yet. The two servers will go hand-in-hand and for a while I will be developing the two in tandem.

It feels like I haven’t added much functionality lately, but the system is much more stable and more robust from the improvements I have been doing.

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Netvouz
  • DZone
  • ThisNext
  • MisterWong
  • Wists