Hi all,

Recently I am planning to move from vpopmail to dbmail.
After I did a quick scan on dbmail's code, I've found that whenever a MTA sends a mail to dbmail, dbmail would try to read everything into memory...and then it would allocate another piece of memory for the INSERT query. Did I miss something or was it meant to be like that? It seems to me that this approach could potentially lead to massive memory consumption, especially on systems where large size attachments are common. I still haven't got the time to read the code in detail though. I apologize if I am talking nonsense. :)


P.S.: If it was really meant to read everything into memory and then copy the same message again to the insert query, why not consider reading everything into a temp file, and then store the msg in db using something like this:

insert msg set id=xxx, body="first 512 bytes of msg goes here...";
update msg set body=body+"another 512 bytes..." where id=xxx;
update msg set body=body+"yet another 512bytes" where id=xxx;

and then ack the MTA after all the data has been propagated into the db to ensure no mail loss? I am not sure how much performance penalty could this bring about, but I think this would be much better than performing everything in memory for a busy site, or otherwise to protect the mail storage subsystem from being DDoS'd.


cheers,
mc.

Reply via email to