Olaf Spaarmann
2009-May-13 11:52 UTC
[Dovecot] What's faster for getting mails into Rails: Dbmail & direct MySQL or net/pop with maildir
Hi, it's my first message in this list, so please excuse any mistakes! I have a quite specific problem and nobody in the Ruby on Rails lists could help me, because it is actually more a question for mail- experts. So I hope you can help me. 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. 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). I thought of 2 different approaches. 1) Just use a normal Dovecot setup, using maildir and get the mails with a mailpoller script, connecting to the server via Pop3 2) Use Dbmail for storing the emails, don't use Pop3 but let the mailpoller script connect to the database directly 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. What's your opinion? I'm gratefull for every hint. Thanks
Curtis Maloney
2009-May-14 04:29 UTC
[Dovecot] What's faster for getting mails into Rails: Dbmail & direct MySQL or net/pop with maildir
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