When I try to send a mail, I get the following error:

gnutls_handshake: An unexpected TLS packet was received.

This is my .muttrc (myname, myaddress and mymail are placeholders):

# Automatically log in to this mailbox at startup
set imap_user="myname"
set imap_pass=""
set spoolfile="imaps://imap.myaddress/Inbox"
set folder="imaps://imap.myaddress/Inbox"
set record="=Sent"
set postponed="=Drafts"

# define how to send mails
set smtp_url="smtps://$imap_user:$imap_pass@smtp.myaddress:587"

# activate TLS if available on the server
set ssl_starttls=yes

# always use SSL when connecting to a server
set ssl_force_tls=yes

# wait to enter mailbox manually
set imap_passive

# Automatically poll subscribed mailboxes for new mail (new in 1.5.11)
set imap_check_subscribed

# Reduce polling frequency to a sane level
set mail_check=60

# And poll the current mailbox more often (not needed with IDLE in post 1.5.11)
#set timeout=10

# keep a cache of headers for faster loading (1.5.9+?)
#set header_cache=~/.hcache

# Display download progress every 5K
set net_inc=5

# Cancel a message when subject is blank
set abort_nosubject=yes

# Set default editor
set editor="gvim -v"

# Asks to include message when replying
set include=ask-yes

# Asks to postpone a message when not sent
set postpone=ask-yes

# Ask before printing
set print=ask-yes

# set from to ensure mutt doesn't put user@localhost.localhost 
set from="myemail"
set use_from=yes
set envelope_from="yes"
  • Possibly an incompatibility with the server. It's going to be difficult to answer this without knowing the server. Can you try with accounts at other providers (e.g. create a throwaway Gmail address)? – Gilles Mar 1 '13 at 23:40
  • I have had this problem and for some reason it seems to work OK on port 465. – user43185 Jul 16 '13 at 21:08

When using smtp submission on port 587, the value for smtp_url should start with "smtp://", i.e. not with "smtps://". It is also important to make sure ssl_starttls is set to "yes", as correctly done in the config above.

While setting up my own server I got the exact same problem. Having access to logs on both the client & the server side, made it obvious that it surely was a client side issue.

A config option starting with smtps tells mutt to open a ssl encrypted connection to the server. However the server is expecting a clear text smtp session which transfers to become encrypted as soon as the client & server have done some negotiation.

  • 2
    If I am right about this (just tested), the same is valid for the set folder="imaps:// entry. It should be set folder="imap:. For example: set folder = "imap://mail.domain.ext:143/". – Nikos Alexandris Feb 17 '16 at 12:56

As of june 2019, Mutt doens't work with TLS1.3, only TLS1.2!

Got this affirmative while testing it with gnutls-bin package version 3.5.8-5+deb9u4, which is TLS 1.0, 1.1 and 1.2 compatible and gnutls-bin 3.6.7-4, which implements TLS 1.0, 1.1, 1.2 and 1.3!

It seems to work that way specifically on Gmail, once it uses the highest version available, becouse on Hostgator server it used TLS 1.2 instead of 1.3, although it was disponible on client machine!

Looks like some sort of SASL-XOAUTH2 error:

SSL/TLS connection using TLS1.3 (ECDHE-RSA/AES-256-GCM/AEAD)[SASL-XOAUTH2] - Requesting authID![SASL-XOAUTH2] - Requesting token

  • 1
    Please provide additional information to resolve the OPs question. This post is from 2013, TLS1.3 was published in 2018. Your statement may be factually correct (that mutt-1.5 probably does not support a protocol published 5 years after this post was made), but it is not an answer that addresses the issue the OP asked. – 0xSheepdog Jun 20 at 21:09

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.