What I'm trying to do: provide an IMAP server as a facade for standardized e-mail access, without using on-disk mailboxes.

What I have:

  • multiple TB of e-mails, stored in MySQL in a completely non-standard format
  • a webservice providing access to these e-mails in a structured way (enumerate/create/delete folders, list/read/delete/send messages, etc.)

Currently, users access their e-mails through a web frontend or a smartphone app (both of which query the webservice for data, under the hood). This works; but I now need to provide access to the mails via IMAP as well.

I have been looking at various IMAP servers, and it seems that Dovecot allows for custom storage backends. However, all the examples I have found are using local mailboxes for storage.

What I'm trying to get to is an IMAP server which would query the webservice for folders/messages instead of looking into a local database/mailbox. (Is this even possible, or would I need to somehow fake the existence of a local file structure, e.g. by writing a FUSE module mimicking http://wiki2.dovecot.org/MailboxFormat/Maildir ?)

  • 1
    (I am fully aware that Databases Are Bad for Email; alas, that's what I have to work with - migrating all of the existing mailboxes is not a feasible option) – Piskvor left the building Dec 1 '14 at 15:41
  • I doubt that you can just configure Dovecot or any other IMAP server to work with what you have. You will have to either write your own specialized IMAP server or write your own storage backend for an existing one. Both are off-topic though. – Sven Dec 1 '14 at 15:46
  • 2
    A quick search leads me to dbmail.org which already has MySQL database as back-end and a matching dbmail-imapd, which may give you head start compared to beginning from scratch. Converting from their schema to your own may be a PITA though. – HBruijn Dec 1 '14 at 15:48
  • @Sven: Thought so (I see how you could perceive this question as shopping-advice ;)) ; I have been deciding between here and SO. Oh well, to StackOverflow (and building my own backend) I go. – Piskvor left the building Dec 1 '14 at 15:49
  • @HBruijn: That might be a useful start, indeed. Thank you very much. – Piskvor left the building Dec 1 '14 at 15:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.