I am expecting lots of problem trying to make mutt work in Ubuntu 12.04. Here is my .muttrc : http://paste.ubuntu.com/1273585/

Here is the bug I am getting when i tried to connect. gnutls_handshake: A TLS packet with unexpected length was received.

Do anyone knows a workaround to fix this error.If so please suggest it asap.

Many Thanks in Advance!

For debug here is the output of my mutt -v: http://paste.ubuntu.com/1273590/

  • Are you on quantal? – mfisch Oct 12 '12 at 4:12
  • No, Ubuntu 12.04! – Vinit Kumar Oct 12 '12 at 5:36
  • I thought it was a 12.10 TLS issue that was fixed a couple days back, but I guess not, sorry. – mfisch Oct 12 '12 at 14:03
  • I had the exact same issue today... And the answer on this page did not help. But the answer here : unix.stackexchange.com/questions/66560/… solved my problem. – yves Baumes May 30 '15 at 19:15

Unfortunately this can be a problem with Mutt and its use of gnutls, as can be seen from the Mutt mailing lists, however there are some solutions.

It is worth removing the header files from .mutt/cache/headers because they can sometimes cause problems. I also note that in your .muttrc you do not have a mailboxes line. I use gmail in Mutt and have the following in my .muttrc (though yours may differ):

mailboxes +INBOX +archive +sent +drafts +spam +trash

I mention this because at Launchpad this error was discussed and someone mentioned that specifying only the correct mailboxes solved his problem.

Comparing your .muttrc to mine in general reveals no other differences, and Mutt and gmail are working for me with almost identical settings.

However, if these suggestions do not solve your problem, it is possible to build Mutt from source and ensure that you build it with openssl support, so you can use openssl instead of gnutls. I note that in your second Pastebin, your Mutt has indeed been built with gnutls, as your debug reveals:


Here - means without that attribute and + means with that attribute.

So, before we start building, purge the currently installed mutt:

sudo apt-get purge mutt

and then get the dependencies with

sudo apt-get build-dep mutt

It is fine to use build-dep here as the latest version of mutt (at this time of writing) doesn't require any newer libraries than those fetched with build-dep.

You will also need to make sure you enter:

sudo apt-get install openssl libsasl2-modules libssl-dev libssl1.0.0

Now download the latest source code from the official site (which is 1.5.21 at time of writing) and then verify the appropriate gpg signature, and cd to the downloaded file and unpack the source code with

tar xzvf mutt-1.5.21.tar.gz 

Then pass these extra options to configure (we need to include the other options as well as ssl as imap and smtp support and other things are not compiled in by default):

./configure --enable-pop --enable-imap --enable-smtp --with-ssl --enable-hcache --with-gss --with-sasl --enable-debug --enable-gpgme

Then proceed to build and then install the program with

sudo make install or sudo checkinstall

The build only takes a few moments and it should allow you to use Mutt again. It is probably a good idea to clear the header cache (as I detailed much further above) before you run the new program. It will use ssl automatically as there is now no tls support built in.

A screenshot from the newly compiled program (showing some older, non-personal emails):

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.