Uploaded image for project: 'James Server'
  1. James Server
  2. JAMES-320

Some messages cause POP3 output stream to freeze on RETR.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Critical
    • Resolution: Fixed
    • Affects Version/s: 2.2.0
    • Fix Version/s: 2.3.0
    • Component/s: POP3Server
    • Labels:
      None
    • Environment:
      Server:
      Fedora Core 2 Linux (x86)
      Sun J2SDK 1.4.2_04

      Clients:
      FreeBSD/Thunderbird
      FreeBSD/Telnet
      Windows XP/Outlook
      Windows XP/Telnet

      Description

      I've been using James on my personal server since about 2.1.3. My domains receive a good deal of spam (on the order of ~1000 per day, spread over the e-mail accounts I host and the postmaster address).

      Some of these messages contain attachments (usually virii) that seem to contain characters that will stop the POP3 transmission in the middle of a RETR.

      Basically, this means that when you RETR an offending message, GUI mail clients time out and telnet sessions just hang until you escape to console and quit.

      If the message is first in the list, this means most clients will not be able to retrieve the rest of the messages in the inbox.

      The only end-user solution is to telnet in, DELE the offending message(s), and then RETR the good ones.

      I'm going to try to attach a sample of an offending message (I haven't used JIRA much). Maybe this is a more general problem with some kind of control characters in the POP3 implementation?

      I haven't had a chance to dig in to James's architecture, but I'd love some pointers.

        Activity

        Hide
        gduffy Greg Duffy added a comment -

        James stops transmission somewhere in the middle of the MIME encoded application/octet-stream

        Show
        gduffy Greg Duffy added a comment - James stops transmission somewhere in the middle of the MIME encoded application/octet-stream
        Hide
        jason_diprinzio jason diprinzio added a comment -

        I've tracked down what I believe to be the issue. In the server logs, the stack trace leads to org/apache/james/pop3server/POP3Handler.readCommandLine.
        In this file line 221, which instantiated a new BufferedReader, was commented out in favor of instantiating a CRLFTerminatedReader. The stacktrace points to line 98 of this class as the last apache class responsible for the exception. I commented out the new line and uncommented out line 221 which temporarily fixed the same problem I was having.

        Show
        jason_diprinzio jason diprinzio added a comment - I've tracked down what I believe to be the issue. In the server logs, the stack trace leads to org/apache/james/pop3server/POP3Handler.readCommandLine. In this file line 221, which instantiated a new BufferedReader, was commented out in favor of instantiating a CRLFTerminatedReader. The stacktrace points to line 98 of this class as the last apache class responsible for the exception. I commented out the new line and uncommented out line 221 which temporarily fixed the same problem I was having.
        Hide
        bago Stefano Bagnara added a comment -

        I think I've rewritten the CRLFTerminatedReader a few months ago. Can you test the latest trunk for this issue or at least compare your patch with the new code?

        I'm not able to reproduce the problem with the mail in attachment.

        Show
        bago Stefano Bagnara added a comment - I think I've rewritten the CRLFTerminatedReader a few months ago. Can you test the latest trunk for this issue or at least compare your patch with the new code? I'm not able to reproduce the problem with the mail in attachment.
        Hide
        bago Stefano Bagnara added a comment -

        This has probably been fixed rewriting CRLFTerminatedReader.
        Will reopen if needed.

        Show
        bago Stefano Bagnara added a comment - This has probably been fixed rewriting CRLFTerminatedReader. Will reopen if needed.
        Hide
        danny@apache.org Danny Angus added a comment -

        Closing issue fixed in released version.

        Show
        danny@apache.org Danny Angus added a comment - Closing issue fixed in released version.

          People

          • Assignee:
            bago Stefano Bagnara
            Reporter:
            gduffy Greg Duffy
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development