Package: enemies-of-carlotta
Version: 1.2.1-1
Severity: normal

The function remove_some_headers contains this code:
        remaining = []
        add_continuation_lines = 0
        for header in headers:
            pos = header.find(":")
            if pos == -1:
                if add_continuation_lines:
                    remaining.append(header)
            else:
                [...]

This messes up the header of an email if it looks like this:
X-Comment: a folded
        header
        line
        containing a colon (":") here

Now if I then try to have EoC remove all X-Comment header lines, it will
keep the line
        containing a colon (":") here
which will become part of another line later...

The code should instead be like this:
        add_continuation_lines = 0
        for header in headers:
            if header[0] in [' ','\t']:
                # this is a continuation line
                if add_continuation_lines:
                    remaining.append(header)
            else:
                pos = header.find(":")
                if pos == -1:
                    # malformed message, try to remove the junk
                    add_continuation_lines = 0
                    continue
                name = header[:pos].lower()
                if name in headers_to_remove:
                    add_continuation_lines = 0
                else:
                    add_continuation_lines = 1
                    remaining.append(header)


-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: powerpc (ppc)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15.1
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages enemies-of-carlotta depends on:
ii  procmail                      3.22-15    Versatile e-mail processor
ii  python                        2.3.5-5    An interactive high-level object-o

enemies-of-carlotta recommends no packages.

-- no debconf information


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to