Menu

#480 IMAPproxy connection cleanup

None
closed-out-of-date
None
5
2022-05-24
2012-11-01
Alexander
No

Hi,

in our setup we had a problem with imapproxy. The problem occurs if a user cancels a attachment download within squirrelmail. After that all folder seems empty and the user has to wait the configured time until imapproxy closes the connections. Debugging the situation we found out, that imapproxy preserves the closed connection and continue to send the attachment data within the next imap connection.

I have prepared a series of two patches to fix this issue:

The first patch renames the ICC_Logout function to ICC_Set_Logout_Time, that accepts a third parameter, that is the value to set the logouttime to. ICC_Logout is a simple wrapper of that function to set the logout time time to the current time (the same behavior as before).

The second patch closes the connection to the server (by setting the logouttime to 1) if an error occurs in the Raw_Proxy method (returning a status code less than 0). This is exactly the case if the client does close the connection within a transfer. The error that occurs is a write error on the closed client fd. If no error occurs the logouttime is set to the current time exactly as before.

The two patches fixes the problem for our setup.

Thanks,
Alex

Discussion

  • Alexander

    Alexander - 2012-11-01
    • summary: IMAPproxy --> IMAPproxy connection cleanup
     
  • Paul Lesniewski

    Paul Lesniewski - 2012-11-01

    Hello. Thanks very much for your help/contribution. Personally I am walking out the door without time to review this, but wanted to make sure you were testing with the current SVN snapshot and not the last release. Is the patch against SVN?

    Thank you!

     
  • Paul Lesniewski

    Paul Lesniewski - 2022-05-24
    • status: open --> closed-out-of-date
    • assigned_to: Paul Lesniewski
    • Group: -->
     
  • Paul Lesniewski

    Paul Lesniewski - 2022-05-24

    Thanks again for your contribution. Upon further review, it looks like indeed that similar problems were already addressed in a newer version of the code than you had at the time. If you find otherwise (please test against version 1.2.8+), we'd love to know. I have added these patches into the /contrib directory so this proposed solution isn't lost.

     

Log in to post a comment.