alienscience / imapsrv

An IMAP server written in Go
BSD 3-Clause "New" or "Revised" License
48 stars 9 forks source link

Remove support for multiple mailstores #13

Closed alienscience closed 9 years ago

alienscience commented 9 years ago

A recent change added support for multiple mailstores. I cannot think of a use case for this and it adds complexity to the session.go code - many commands will require loops. It may also be difficult to merge the results from different mailstores, e.g when moving to a subfolder.

The idea of a Mailstore is based on the Apache James IMAP architecture. This project has just one Mailstore. I think it would be easiest to keep things simple for now and remove support for multiple mailstores.

g-dormoy commented 9 years ago

It depends, will it case a big refactoring to support multiple mailstore if we do it later? It can be useful if we think of a server with different users, each user could have a mailstore in their home directory with multiple mailbox

xarg commented 9 years ago

It's me who added that change. The use case for multiple mailstores was that you could use maildir for local addresses and a SQL backend for a more serious production environment at the same time. Now that I think of it, it might not be a real problem so I'm going to remove the support for this.

I also assumed that a mailbox can only be located in one mailstore. I guess I assumed wrong. For example:

You can't have alex@email.com in maildir and alex@email.com in an SQL storage at the same time. It doesn't make any sense to me and would brake things in weird ways.

g-dormoy commented 9 years ago

Thx for the fix @xarg