Package: mutt
Version: 1.5.20-9
Severity: normal

I archive some old Mail in mbox files.  Recently one of those has become
larger than 2GiB.  Mutt still appears to be able to read the headers
correctly, but instead of the body it displays some random chunk of the mbox
file for mails starting after the 2GiB boundary in the mbox.  The exact
conditions appears to be that the body must start before 2GiB for everything
to work fine, even if the body then crosses the 2GiB barrier.

Here is a collection of what works and what doesn't for mails after the 2GiB
barrier:

Works:

 - Headers are displayed correctly.

 - Piping the entire mail to some shell-command.

 - Viewing the structure of a MIME-message in the attachmend browser.

 - From the attachment browser: Viewing (and piping) some parts of
   MIME-messages, such as a GPG signature.

Doesn't work:

 - Displaying the body.

 - Verifying GPG-Encrypted messages.

 - From the attachment browser: Viewing (and piping) some parts of
   MIME-messages, such as GPG-signed text.

 - From the attachment browser: Viewing (and piping) some parts of messages
   such as the body-text of non-multipart mails.  I even get a different part
   of the mbox file for the first 5 to 10 tries, until it settles to only show
   me empty text.

The attached perl script will generate a mbox file slightly larger than 2GiB
on stdout to illustrate the problem.  Note that it had to be a script because
I had to give each mail in the mbox a unique Message-ID, otherwise mutt
assumes they are all in one thread and takes ages to sort the mails for
display.  In an mbox generated by the unmodified skript the last two mails
show the broken behaviour.

I suggest to either fix the broken behaviour.  If that proves to be too
difficult, I suggest to refuse opening mbox files larger than 2GiB (at least
on 32 bit architectures).  This smells like some integer overflow and those
tend to have security implications.

Thanks,
Jö.

-- Package-specific info:
Mutt 1.5.20 (2009-06-14)
Copyright (C) 1996-2009 Michael R. Elkins and others.
Mutt comes with ABSOLUTELY NO WARRANTY; for details type `mutt -vv'.
Mutt is free software, and you are welcome to redistribute it
under certain conditions; type `mutt -vv' for details.

System: Linux 2.6.32-5-amd64 (x86_64)
ncurses: ncurses 5.7.20100313 (compiled with 5.7)
libidn: 1.15 (compiled with 1.18)
hcache backend: tokyocabinet 1.4.37
Compile options:
-DOMAIN
+DEBUG
-HOMESPOOL  +USE_SETGID  +USE_DOTLOCK  +DL_STANDALONE  +USE_FCNTL  -USE_FLOCK   
+USE_POP  +USE_IMAP  +USE_SMTP  
-USE_SSL_OPENSSL  +USE_SSL_GNUTLS  +USE_SASL  +USE_GSS  +HAVE_GETADDRINFO  
+HAVE_REGCOMP  -USE_GNU_REGEX  
+HAVE_COLOR  +HAVE_START_COLOR  +HAVE_TYPEAHEAD  +HAVE_BKGDSET  
+HAVE_CURS_SET  +HAVE_META  +HAVE_RESIZETERM  
+CRYPT_BACKEND_CLASSIC_PGP  +CRYPT_BACKEND_CLASSIC_SMIME  +CRYPT_BACKEND_GPGME  
-EXACT_ADDRESS  -SUN_ATTACHMENT  
+ENABLE_NLS  -LOCALES_HACK  +COMPRESSED  +HAVE_WC_FUNCS  +HAVE_LANGINFO_CODESET 
 +HAVE_LANGINFO_YESEXPR  
+HAVE_ICONV  -ICONV_NONTRANS  +HAVE_LIBIDN  +HAVE_GETSID  +USE_HCACHE  
-ISPELL
SENDMAIL="/usr/sbin/sendmail"
MAILPATH="/var/mail"
PKGDATADIR="/usr/share/mutt"
SYSCONFDIR="/etc"
EXECSHELL="/bin/sh"
MIXMASTER="mixmaster"
To contact the developers, please mail to <mutt-...@mutt.org>.
To report a bug, please visit http://bugs.mutt.org/.

misc/am-maintainer-mode
misc/hg.pmdef.debugtime
debian-specific/build_doc_adjustments.diff
features/ifdef
features/xtitles
features/trash-folder
features/purge-message
features/sensible_browser_position
features-old/patch-1.5.4.vk.pgp_verbose_mime
features/compressed-folders
features/compressed-folders.debian
debian-specific/Muttrc
debian-specific/Md.etc_mailname_gethostbyname.diff
debian-specific/use_usr_bin_editor.diff
debian-specific/correct_docdir_in_man_page.diff
debian-specific/dont_document_not_present_features.diff
debian-specific/document_debian_defaults
debian-specific/assumed_charset-compat
debian-specific/467432-write_bcc.patch
misc/define-pgp_getkeys_command.diff
misc/gpg.rc-paths
misc/smime.rc
upstream/533209-mutt_perror.patch
upstream/533459-unmailboxes.patch
upstream/533439-mbox-time.patch
upstream/531430-imapuser.patch
upstream/534543-imap-port.patch
upstream/538128-mh-folder-access.patch
upstream/537818-emptycharset.patch
upstream/535096-pop-port.patch
upstream/542910-search-segfault.patch
upstream/533370-pgp-inline.patch
upstream/533520-signature-highlight.patch
upstream/393926-internal-viewer.patch
upstream/543467-thread-segfault.patch
upstream/544180-italian-yesorno.patch
upstream/542817-smimekeys-tmpdir.patch
upstream/544794-smtp-batch.patch
upstream/537694-segv-imap-headers.patch
upstream/548577-gpgme-1.2.patch
upstream/548494-swedish-intl.patch
upstream/553321-ansi-escape-segfault.patch
upstream/553238-german-intl.patch
upstream/557395-muttrc-crypto.patch
upstream/545316-header-color.patch
upstream/568295-references.patch
upstream/547980-smime_keys-chaining.patch
upstream/528233-readonly-open.patch
upstream/228671-pipe-mime.patch
upstream/383769-score-match.patch
upstream/547739-manual-typos.patch
upstream/311296-rand-mktemp.patch
upstream/573823-imap_internal_date
upstream/542344-dont_fold_From_
upstream/path_max
misc/hyphen-as-minus.patch
misc/smime_keys-manpage.patch
mutt.org

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing-proposed-updates
  APT policy: (500, 'testing-proposed-updates'), (500, 'testing')
Architecture: i386 (x86_64)

Kernel: Linux 2.6.32-5-amd64 (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages mutt depends on:
ii  libc6                  2.11.2-6+squeeze1 Embedded GNU C Library: Shared lib
ii  libcomerr2             1.41.12-2         common error description library
ii  libgnutls26            2.8.6-1           the GNU TLS library - runtime libr
ii  libgpg-error0          1.6-1             library for common error values an
ii  libgpgme11             1.2.0-1.2         GPGME - GnuPG Made Easy
ii  libgssapi-krb5-2       1.8.3+dfsg-2      MIT Kerberos runtime libraries - k
ii  libidn11               1.15-2            GNU Libidn library, implementation
ii  libk5crypto3           1.8.3+dfsg-2      MIT Kerberos runtime libraries - C
ii  libkrb5-3              1.8.3+dfsg-2      MIT Kerberos runtime libraries
ii  libncursesw5           5.7+20100313-4    shared libraries for terminal hand
ii  libsasl2-2             2.1.23.dfsg1-6    Cyrus SASL - authentication abstra
ii  libtokyocabinet8       1.4.37-6          Tokyo Cabinet Database Libraries [

Versions of packages mutt recommends:
ii  exim4-daemon-light [ma 4.72-1            lightweight Exim MTA (v4) daemon
ii  libsasl2-modules       2.1.23.dfsg1-6    Cyrus SASL - pluggable authenticat
ii  locales                2.11.2-6+squeeze1 Embedded GNU C Library: National L
ii  mime-support           3.48-1            MIME files 'mime.types' & 'mailcap

Versions of packages mutt suggests:
ii  aspell                     0.60.6-4      GNU Aspell spell-checker
ii  ca-certificates            20090814+nmu2 Common CA certificates
ii  gnupg                      1.4.10-4      GNU privacy guard - a free PGP rep
ii  ispell                     3.1.20.0-7    International Ispell (an interacti
pn  mixmaster                  <none>        (no description available)
ii  openssl                    0.9.8o-2      Secure Socket Layer (SSL) binary a
ii  urlview                    0.9-18.1      Extracts URLs from text

Versions of packages mutt is related to:
ii  mutt                          1.5.20-9   text-based mailreader supporting M
pn  mutt-dbg                      <none>     (no description available)
pn  mutt-patched                  <none>     (no description available)

-- no debconf information

-- 
Computers are like air conditioners.  Both stop working, if you open
windows.
-- Adam Heath
#!/usr/bin/perl

use strict;
use warnings;

sub print_mail( $ );
sub print_mail_encrypted( $ );

sub print_mail( $ ) { return print_mail_plain($_[0]) }

my $size = 0;
my $index = 1;

# * repeat the mail until the mailbox is bigger than 2GiB
# * customize the Message-ID: of each mail with the number of the mail so mutt
#   will not try to put them all into one thread (way too slow)
while($size < 2*1024**3) {
    $size += print_mail($index);
    ++$index;
}

# print one more mail that starts after the 2GiB boundary
print_mail($index);

sub print_mail_plain( $ ) {
    my $text = <<EOT;
From jorr...@jorrit.de Mon Nov  1 22:36:59 2010
Received: from joe by paranoia.fritz.box with local (Exim 4.72)
        (envelope-from <jorr...@jorrit.de>)
        id 1PD23n-0002Ym-RU
        for j...@localhost; Mon, 01 Nov 2010 22:36:59 +0100
Date: Mon, 1 Nov 2010 22:36:59 +0100
From: =?iso-8859-1?Q?J=F6?= Fahlke <jorr...@jorrit.de>
To: =?iso-8859-1?Q?J=F6?= <j...@localhost>
Subject: test
Message-ID: <$_[0].20101101213659.ge298...@paranoia>
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
User-Agent: Mutt/1.5.20 (2009-06-14)
Content-Length: 195

test

--=20
Interpunktion, Orthographie und Grammatik der Email ist frei erfunden.
Eine =DCbereinstimmung mit aktuellen oder ehemaligen Regeln w=E4re rein
zuf=E4llig und ist nicht beabsichtigt.


EOT

    print $text;
    return length $text;
}

sub print_mail_encrypted( $ ) {
    my $text = <<EOT;
From jorr...@jorrit.de Mon Nov  1 16:23:21 2010
Received: from joe by paranoia.fritz.box with local (Exim 4.72)
        (envelope-from <jorr...@jorrit.de>)
        id 1PCwED-0007od-ED
        for j...@localhost; Mon, 01 Nov 2010 16:23:21 +0100
Date: Mon, 1 Nov 2010 16:23:21 +0100
From: =?iso-8859-1?Q?J=F6?= Fahlke <jorr...@jorrit.de>
To: =?iso-8859-1?Q?J=F6?= <j...@localhost>
Subject: test
Message-ID: <$_[0].20101101152321.ga298...@paranoia>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha256;
        protocol="application/pgp-signature"; boundary="HlL+5n6rz5pIUxbD"
Content-Disposition: inline
User-Agent: Mutt/1.5.20 (2009-06-14)
Status: RO
Content-Length: 1262


--HlL+5n6rz5pIUxbD
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

test

--=20
Q: How does a Unix guru have sex?
A: unzip;strip;touch;finger;mount;fsck;more;yes;umount;sleep
-- unknown source

--HlL+5n6rz5pIUxbD
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iQIVAwUBTM7baemx9CKgc0OWAQgKEQ//a2zxjK66T/zKCMHpR1/BXbhS1KG8J6aN
pi5QlwooiWuDX0jxjx31xbV0CwsQ/XUD5MZAQUBad7UMdmpxzgEC4uQsdT5OgyZP
1XTlHAuAbdg5tlbwoERjVVLJDDy39HqSUXNl9s43WjRx5luGBl5vE9AXN3T2WXwM
vC6RgIMQulhhgR64B1k1Z9lfOYCbvWO+M0YhtxZ0rgmo4lCMKj6dU1xLS4pZxxUJ
40vDKd991941jQN4VMvulS+jMuO4StPaIg6bWfEeVfPS3m9uFlxEuTQ0FXZ5RYEB
6PEuc0dNCwgCpuLR6xdMbpWcDJZMcbUki1xic8J9TOl9FW/ggjYv+WAXhg8XjPMd
yFlpbb97Whh7BDxGnlnnVHVUHyQJppG3Foq5YjKa7UMRpQMjPk2f1CaQYWbHfjBp
scbG1FnTGF2BuTycEq2Du2hA30zJ/GFA+5lUd7/vr1tJHGmfeRCd7eI09YEnpCiG
r5eoSy2p5id+qZkW+U+kA9yDVDaeKLORNF+hLgh/8V/KkS6g3APdqfFxkedHHUxI
iDMmFHLuGD6MY7DqI7PfnvuxaferALLCdaSuH2iiqjA16wWjjXe8aX3NN296L4Bn
ZKfdEGL4uDK7am9kHWusQP/ZrW5mUH566Ay95oZQcNB7k8i5ySmfLMPjLB4NJgpg
qaEk0K/VEYU=
=a48j
-----END PGP SIGNATURE-----

--HlL+5n6rz5pIUxbD--


EOT
# un-confuse emacs' syntax highlighting

=pod

=cut

    print $text;
    return length $text;
}

Attachment: signature.asc
Description: Digital signature

Reply via email to