Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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/

share|improve this question
    
Are you on quantal? –  mfisch Oct 12 '12 at 4:12
    
No, Ubuntu 12.04! –  Vinit 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
add comment

1 Answer 1

up vote 5 down vote accepted
+50

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:

-USE_SSL_OPENSSL  +USE_SSL_GNUTLS

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

make 
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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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