[Dovecot] What's faster for getting mails into Rails: Dbmail & direct MySQL or net/pop with maildir

Curtis Maloney cmaloney at cardgate.net
Thu May 14 07:29:15 EEST 2009


Olaf Spaarmann wrote:
> Hi,

> I'm planning to set up a mailserver using dovecot. Users of my Rails App 
> can forward their emails (john at doe.com) to an personal address 
> (john.doe at myapp.com). These emails will be received by my mailserver.

Will people be accessing mail other than via your RoR app?  If not, my 
suggestion below could simplify things...

> So far so good, the tricky part is to get the mails into my Rails App 
> for processing them. After that they will be deleted (so I'll never 
> accumulate a big ammount of mails on the mailserver).

If the mail is to be delivered directly to your RoR app (I'm guessing you'll 
import it into your SQL DB, instead of using a mail-specific DB?) why not 
have a custom LDA that imports the message on delivery?

This would remove the need for Dovecot entirely, and give you instant 
update.  True, it would require you to write a compatible LDA, and you could 
take some tips from Dovecot deliver in doing that.

> I understand that Dbmail seems to be slower than maildir (in terms of 
> processing many incoming mails) but I'm not sure if a connection via 
> net/pop (of the mailpoller script) is maybe that much slower than mysql 
> that it wouldn't matter at all.

That's because DBMail is using a "general purpose" SQL database, whereas 
mbox and maildir are "special purpose" databases, specifically designed for 
mail storage.

-- 
Curtis Maloney
cmaloney at cardgate.net



More information about the dovecot mailing list