[imp] Large Search on mailbox causes logout [SOLVED]

Darragh Bailey felix at compsoc.nuigalway.ie
Tue Oct 5 02:41:03 PDT 2004


Quoting felix at compsoc.nuigalway.ie:

> Hi,
>
>
> Noticed a problem before when running large searchs on mail boxes using imp.
> On
> a website that I help run and build we integrated horde 2.2.5 & imp 3.2.5
> into
> the website so that only 1 login from the site was needed and it would log
> you
> into horde & imp as well.
>
> However for some users if they run large searchs across their mail boxes imp
> destroys its session and logs them out. Naturally we have a few additionally
> problems since it doesn't destroy the main site session, but thats a
> separate
> issue.
>
> I've been able to replicate this issue for a good deal of time, I have 80
> folders and to break imp all I have to do is:
> go to the search page
> select all folders to search (80)
> insert "break imp" to search in the body of each mail.

<snipped>

Well the problem was actually to do with the way the imapd server was being
accessed on the machine. I'm posting the solution here just in case anyone else
encounters a similar problem in the future.

The server was running uw-imapd through inet and as a result it had certain
entries in the /etc/inet.conf file that dictated how connections to various
services were to be handled.

The entries for the imapd server failed to specify the max number of this
process that inet was permitted to spawn within 60 seconds, as a result it was
limited to the default of 40. Since PHP does not (currently) support persistent
imap connections the net effect of searching 80 folders was to call imap_open 80
times thereby causing inet to block connection attempts to imap after it reached
the limit of 40 for the 60 seconds.

As a result the search failed to work on the latter folders and additionally
when you went to access and section afterwards you would be logged out as imp
would attempt to reauthenicate your access and get connection refused from inet,
and mistakenly thing that it was a failed login attempt.

Identification of the problem is thanks to "raditha dissanayake" from the
php-general mailing list who said

"This probably means that your imap server is running under xinetd (or something
similar) that has a rate limit or a limit on the number of connections from one
client. You can find out how many connections are open with netstat and i think
you will find it's reached the allowed limit."

Just to give create where its due.


>From some further posts the solution is

1) Increase the limit for xinetd or inetd to allow a greater number of
connections.

2) Run an imap proxy to handle the calls from imp/horde so that it can maintain
persistent connections to the imapd and thereby avoid the problem


I would imagine that this could also be the cause of unexplained failed logins
for users using imp as well. That they get connection refused and failed login
due to the number of users having used up all the available connections allowed
by inetd. Also users being logged out unexpectedly as well.


--
Darragh

"Nothing's foolproof to a sufficently talented fool"


More information about the imp mailing list