Problems with memory usage on large emails
0 answers - 1917 bytes -

Friedrich G <fred (AT) akg-images (DOT) co.ukwrote:
I'm using a MultidropPP3Retriever with a MultiSorter to receive mail from a
domain mailbox. It worked fine until someone sent a 50 Mb zip file attached
to a mail. At least part of the problem seems to be that getmail seems to
fully load the mails into memory before writing them to disk.
Yes, it does. It basically has to; it's retrieving that data from a remote
server and has to keep it *somewhere* while it's retrieving it.
Also the box has only 256 Mb RAM (+ 1 Gb Swap).
Then a getmail process that occupies 60 or 70MB of memory, all of it
swappable, shouldn't be a problem. I regularly receive much bigger messages,
and I used to run getmail on a box with only 64MB of memory.
Anyways, it failed with this:
[]
File "/usr/lib/python2.4/poplib.py", line 141, in _getresp
raise error_proto(resp)
poplib.error_proto: -ERR PP timeout
That's not a memory issue. If the problem was "out of memory", you'd get a
message that includes the word "MemoryError".
This seems to point to a server problem, but I was able to retrieve all
the emails on a box with even less ram using evolution.
It is a server problem. The server stopped responding partway through a
session.
So, my question is if there is some way to make getmail not use so much
memory, or if this is the result of a bug/incompatibility.
You've misdiagnosed the problem; the above error was *not* the result of a
memory allocation error -- it was simply an unresponsive server. getmail does
everything it can in this situation, but there's not much it can do to work
around unreliable servers. Try using the "max_messages_per_session"
configuration option; it's designed to help alleviate problems with faulty
servers.
Charles