Re: [Mutt] #3266: mutt-1.5.19: Complete hang while sending mail
#3266: mutt-1.5.19: Complete hang while sending mail through SMTPS
----------------------+-----------------------------------------------------
Reporter: Darwish | Owner: brendan
Type: defect | Status: accepted
Priority: major | Milestone: 1.6
Component: SMTP | Version: 1.5.19
Resolution: | Keywords: smtps, gmail, hang
----------------------+-----------------------------------------------------
Changes (by brendan):
* owner: mutt-dev => brendan
* priority: blocker => major
* status: new => accepted
* component: mutt => SMTP
Old description:
> Using 1.5.19 for IMAPS browsing is really nice, but sending mail
> through SMTPS leaves mutt in a dead-hang mode with a fairly
> reproduceable rate. Once the hang bug is triggered, only SIGQUIT
> (Ctrl-"\") is able to terminate mutt.
>
> Steps to reproduce:
>
> 1. Login using a Google account to imaps://imap.google.com:993 [[BR]]
> 2. Compose a new message: press the <mail> button[[BR]]
> 3. Write mail content[[BR]]
> 4. Send the mail: press the <send-message> button[[BR]]
>
> Status bar messages in order:
>
> {{{
> Connecting to smtp.gmail.com...
> SSL/TLS connection using TLS 1.0 (RSA/ARCFOUR 128/MD5)
> Authenticating (LOGIN)...
> Sending message... 0K/0.3K (0%)
>
> .. Complete hang ..
> }}}
>
> A similar bug was reported on 2007, and was closed from 10 months ago
> as "defect:worksforme" with no further response by original bug reporter:
> http://dev.mutt.org/trac/ticket/2961
>
> * IMAPS and SMTPS conf:
>
> {{{
> set imap_user = 'user@xxxxxxxxx'
> set imap_pass = 'password'
> set spoolfile = "imaps://imap.gmail.com:993/Mine"
> ...
> set smtp_url="smtps://user\@gmail.com@smtp.gmail.com:465/"
> set smtp_pass = "password"
> }}}
>
> * Compile options:
>
> {{{
> ./configure --prefix /usr/local/ --enable-pop --enable-imap \
> --enable-smtp --enable-debug --enable-flock --enable-exact-address \
> --enable-hcache --with-curses --with-regex --with-gnutls --with-sasl
> }}}
>
> * Debugging output:
>
> NOTE: "External authentication name" value is a _corrupted_ non-ascii
> string. Its value in hex (5 letters/bytes) is: "21 BB9E BF06"
>
> {{{
> $ # Yes, it prints "Debugging at level 2." although "-d 5" is chosen
> $ mutt -d 5
>
> Mutt 1.5.17+20080114 started at Mon Jun 15 17:59:54 2009
> .
> Debugging at level 2.
>
> Reading configuration file '/etc/Muttrc'.
> Reading configuration file '/usr/lib/mutt/source-muttrc.d|'.
> Reading configuration file '/etc/Muttrc.d/charset.rc'.
> Reading configuration file '/etc/Muttrc.d/colors.rc'.
> Reading configuration file '/etc/Muttrc.d/compressed-folders.rc'.
> Reading configuration file '/etc/Muttrc.d/gpg.rc'.
> Reading configuration file '/etc/Muttrc.d/smime-paths.rc'.
> Reading configuration file '/home/darwish/.muttrc'.
> Connected to imap.gmail.com:993 on fd=5
> 5< * OK Gimap ready for requests from 41.237.142.142 j10if10371594mue.0
> 5> a0000 CAPABILITY^M
> 5< * CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA XLIST CHILDREN
> XYZZY
> 5< a0000 OK Thats all she wrote! j10if10371594mue.0
> imap_authenticate: Using any available method.
> local ip: 192.168.1.243;51046, remote ip:209.85.135.109;993
> External SSF: 128
> External authentication name: !»\236<corrupted-character>^F (Note:5
> characters)
> SASL: No worthy mechs found
> imap_auth_sasl: IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA XLIST CHILDREN
> XYZZY unavailable
> Sending LOGIN command for darwish.07@xxxxxxxxxxxx
> 5< a0001 OK darwish.07@xxxxxxxxx authenticated (Success)
> Communication encrypted at 128 bits
> 5> a0002 CAPABILITY^M
> a0003 LIST "" ""^M
> 5< * CAPABILITY IMAP4rev1 UNSELECT LITERAL+ IDLE NAMESPACE QUOTA ID XLIST
> CHILDREN X-GM-EXT-1
> 5< a0002 OK Success
> 5< * LIST (\Noselect) "/" "/"
> 5< a0003 OK Success
> 5> a0004 STATUS "[Gmail]/Drafts" (MESSAGES)^M
> a0005 SELECT "Mine"^M
> 5< * STATUS "[Gmail]/Drafts" (MESSAGES 0)
> 5< a0004 OK Success
> 5< * FLAGS (\Answered \Flagged \Draft \Deleted \Seen)
> Getting mailbox FLAGS
> 5< * OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen \*)]
> Getting mailbox PERMANENTFLAGS
> 5< * OK [UIDVALIDITY 45]
> Getting mailbox UIDVALIDITY
> 5< * 11 EXISTS
> Handling EXISTS
> cmd_handle_untagged: New mail in Mine - 11 messages total.
> 5< * 0 RECENT
> 5< * OK [UNSEEN 4]
> 5< * OK [UIDNEXT 13685]
> Getting mailbox UIDNEXT
> 5< a0005 OK [READ-WRITE] Mine selected. (Success)
> ../../imap/message.c:104: mutt_mktemp returns "/tmp/mutt-HOME-
> LAPTOP-1000-29222-0".
> Updating progress: 0
> 5> a0006 UID FETCH 1:13684 (UID FLAGS)^M
> 5< * 1 FETCH (UID 12281 FLAGS (\Seen))
> 5< * 2 FETCH (UID 12400 FLAGS (\Seen))
> 5< * 3 FETCH (UID 12612 FLAGS (\Seen))
> 5< * 4 FETCH (UID 12704 FLAGS (\Seen))
> 5< * 5 FETCH (UID 12786 FLAGS (\Seen))
> 5< * 6 FETCH (UID 13679 FLAGS (\Seen))
> 5< * 7 FETCH (UID 13680 FLAGS (Old))
> 5< * 8 FETCH (UID 13681 FLAGS (Old))
> 5< * 9 FETCH (UID 13682 FLAGS (Old))
> Updating progress: 10
> 5< * 10 FETCH (UID 13683 FLAGS (\Seen))
> 5< * 11 FETCH (UID 13684 FLAGS ())
> Updating progress: 0
> imap_open_mailbox: msgcount is 11
> mutt_num_postponed: 0 postponed IMAP messages found.
> 5> a0007 STATUS "[Gmail]/Drafts" (MESSAGES)^M
> 5< a0006 OK Success
> 5< * STATUS "[Gmail]/Drafts" (MESSAGES 0)
> 5< a0007 OK Success
> mutt_num_postponed: 0 postponed IMAP messages found.
> ../send.c:1184: mutt_mktemp returns "/tmp/mutt-HOME-LAPTOP-1000-29222-1".
> ../headers.c:47: mutt_mktemp returns "/tmp/mutt-HOME-
> LAPTOP-1000-29222-2".
> ../send.c:977: mutt_mktemp returns "/tmp/mutt-HOME-LAPTOP-1000-29222-3".
> Connected to smtp.gmail.com:465 on fd=6
> 6< 220 mx.google.com ESMTP s10sm5562440mue.8
> 6> EHLO HOME-LAPTOP^M
> 6< 250-mx.google.com at your service, [41.237.142.142]
> 6< 250-SIZE 35651584
> 6< 250-8BITMIME
> 6< 250-AUTH LOGIN PLAIN
> 6< 250-ENHANCEDSTATUSCODES
> 6< 250 PIPELINING
> local ip: 192.168.1.243;41538, remote ip:209.85.135.111;465
> External SSF: 128
> External authentication name: darwish.07@xxxxxxxxx
> 6> AUTH LOGIN^M
> 6< 334 VXNlcm5hbWU6
> mutt_sasl_cb_authname: getting authname for smtp.gmail.com:465
> mutt_sasl_cb_pass: getting password for
> darwish.07@xxxxxxxxx@smtp.gmail.com:465
> 6> ZGFyd2lzaC4wN0BnbWFpbC5jb20=^M
> 6< 334 UGFzc3dvcmQ6
> 6> TW9TXzI1Ny9UYV8=^M
> 6< 235 2.7.0 Accepted
> 6> MAIL FROM:<darwish.07@xxxxxxxxx>^M
> 6< 250 2.1.0 OK s10sm5562440mue.8
> 6> RCPT TO:<darwish.07@xxxxxxxxx>^M
> 6< 250 2.1.5 OK s10sm5562440mue.8
> Updating progress: 0
> 6> DATA^M
> 6< 354 Go ahead s10sm5562440mue.8
> Updating progress: 38
> Updating progress: 86
> Updating progress: 111
> Updating progress: 129
> Updating progress: 178
> Updating progress: 196
> Updating progress: 239
> Updating progress: 267
> Updating progress: 313
> Updating progress: 314
> Updating progress: 324
> 6> .^M
> }}}
>
> mutt -v:
>
> {{{
> $ mutt -v
> Mutt 1.5.19 (2009-01-05)
> <Copyrights boilerplate>
>
> System: Linux 2.6.29 (i686)
> ncurses: ncurses 5.6.20071124 (compiled with 5.6)
> hcache backend: GDBM version 1.8.3. 10/15/2002 (built Jun 15 2006
> 21:19:27)
> 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 +HAVE_WC_FUNCS +HAVE_LANGINFO_CODESET
> +HAVE_LANGINFO_YESEXPR
> +HAVE_ICONV -ICONV_NONTRANS -HAVE_LIBIDN +HAVE_GETSID +USE_HCACHE
> ISPELL="/usr/bin/ispell"
> SENDMAIL="/usr/sbin/sendmail"
> MAILPATH="/var/mail"
> PKGDATADIR="/usr/local//share/mutt"
> SYSCONFDIR="/usr/local//etc"
> EXECSHELL="/bin/sh"
> -MIXMASTER
> }}}
New description:
Using 1.5.19 for IMAPS browsing is really nice, but sending mail
through SMTPS leaves mutt in a dead-hang mode with a fairly
reproduceable rate. Once the hang bug is triggered, only SIGQUIT
(Ctrl-"\") is able to terminate mutt.
Steps to reproduce:
1. Login using a Google account to imaps://imap.google.com:993 [[BR]]
2. Compose a new message: press the <mail> button[[BR]]
3. Write mail content[[BR]]
4. Send the mail: press the <send-message> button[[BR]]
Status bar messages in order:
{{{
Connecting to smtp.gmail.com...
SSL/TLS connection using TLS 1.0 (RSA/ARCFOUR 128/MD5)
Authenticating (LOGIN)...
Sending message... 0K/0.3K (0%)
.. Complete hang ..
}}}
A similar bug was reported on 2007, and was closed from 10 months ago
as "defect:worksforme" with no further response by original bug reporter:
http://dev.mutt.org/trac/ticket/2961
* IMAPS and SMTPS conf:
{{{
set imap_user = 'user@xxxxxxxxx'
set imap_pass = 'password'
set spoolfile = "imaps://imap.gmail.com:993/Mine"
...
set smtp_url="smtps://user\@gmail.com@smtp.gmail.com:465/"
set smtp_pass = "password"
}}}
* Compile options:
{{{
./configure --prefix /usr/local/ --enable-pop --enable-imap \
--enable-smtp --enable-debug --enable-flock --enable-exact-address \
--enable-hcache --with-curses --with-regex --with-gnutls --with-sasl
}}}
* Debugging output:
NOTE: "External authentication name" value is a _corrupted_ non-ascii
string. Its value in hex (5 letters/bytes) is: "21 BB9E BF06"
{{{
$ # Yes, it prints "Debugging at level 2." although "-d 5" is chosen
$ mutt -d 5
Mutt 1.5.17+20080114 started at Mon Jun 15 17:59:54 2009
.
Debugging at level 2.
Reading configuration file '/etc/Muttrc'.
Reading configuration file '/usr/lib/mutt/source-muttrc.d|'.
Reading configuration file '/etc/Muttrc.d/charset.rc'.
Reading configuration file '/etc/Muttrc.d/colors.rc'.
Reading configuration file '/etc/Muttrc.d/compressed-folders.rc'.
Reading configuration file '/etc/Muttrc.d/gpg.rc'.
Reading configuration file '/etc/Muttrc.d/smime-paths.rc'.
Reading configuration file '/home/darwish/.muttrc'.
Connected to imap.gmail.com:993 on fd=5
5< * OK Gimap ready for requests from 41.237.142.142 j10if10371594mue.0
5> a0000 CAPABILITY^M
5< * CAPABILITY IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA XLIST CHILDREN
XYZZY
5< a0000 OK Thats all she wrote! j10if10371594mue.0
imap_authenticate: Using any available method.
local ip: 192.168.1.243;51046, remote ip:209.85.135.109;993
External SSF: 128
External authentication name: !»\236<corrupted-character>^F (Note:5
characters)
SASL: No worthy mechs found
imap_auth_sasl: IMAP4rev1 UNSELECT IDLE NAMESPACE QUOTA XLIST CHILDREN
XYZZY unavailable
Sending LOGIN command for darwish.07@xxxxxxxxxxxx
5< a0001 OK darwish.07@xxxxxxxxx authenticated (Success)
Communication encrypted at 128 bits
5> a0002 CAPABILITY^M
a0003 LIST "" ""^M
5< * CAPABILITY IMAP4rev1 UNSELECT LITERAL+ IDLE NAMESPACE QUOTA ID XLIST
CHILDREN X-GM-EXT-1
5< a0002 OK Success
5< * LIST (\Noselect) "/" "/"
5< a0003 OK Success
5> a0004 STATUS "[Gmail]/Drafts" (MESSAGES)^M
a0005 SELECT "Mine"^M
5< * STATUS "[Gmail]/Drafts" (MESSAGES 0)
5< a0004 OK Success
5< * FLAGS (\Answered \Flagged \Draft \Deleted \Seen)
Getting mailbox FLAGS
5< * OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen \*)]
Getting mailbox PERMANENTFLAGS
5< * OK [UIDVALIDITY 45]
Getting mailbox UIDVALIDITY
5< * 11 EXISTS
Handling EXISTS
cmd_handle_untagged: New mail in Mine - 11 messages total.
5< * 0 RECENT
5< * OK [UNSEEN 4]
5< * OK [UIDNEXT 13685]
Getting mailbox UIDNEXT
5< a0005 OK [READ-WRITE] Mine selected. (Success)
../../imap/message.c:104: mutt_mktemp returns "/tmp/mutt-HOME-
LAPTOP-1000-29222-0".
Updating progress: 0
5> a0006 UID FETCH 1:13684 (UID FLAGS)^M
5< * 1 FETCH (UID 12281 FLAGS (\Seen))
5< * 2 FETCH (UID 12400 FLAGS (\Seen))
5< * 3 FETCH (UID 12612 FLAGS (\Seen))
5< * 4 FETCH (UID 12704 FLAGS (\Seen))
5< * 5 FETCH (UID 12786 FLAGS (\Seen))
5< * 6 FETCH (UID 13679 FLAGS (\Seen))
5< * 7 FETCH (UID 13680 FLAGS (Old))
5< * 8 FETCH (UID 13681 FLAGS (Old))
5< * 9 FETCH (UID 13682 FLAGS (Old))
Updating progress: 10
5< * 10 FETCH (UID 13683 FLAGS (\Seen))
5< * 11 FETCH (UID 13684 FLAGS ())
Updating progress: 0
imap_open_mailbox: msgcount is 11
mutt_num_postponed: 0 postponed IMAP messages found.
5> a0007 STATUS "[Gmail]/Drafts" (MESSAGES)^M
5< a0006 OK Success
5< * STATUS "[Gmail]/Drafts" (MESSAGES 0)
5< a0007 OK Success
mutt_num_postponed: 0 postponed IMAP messages found.
../send.c:1184: mutt_mktemp returns "/tmp/mutt-HOME-LAPTOP-1000-29222-1".
../headers.c:47: mutt_mktemp returns "/tmp/mutt-HOME-LAPTOP-1000-29222-2".
../send.c:977: mutt_mktemp returns "/tmp/mutt-HOME-LAPTOP-1000-29222-3".
Connected to smtp.gmail.com:465 on fd=6
6< 220 mx.google.com ESMTP s10sm5562440mue.8
6> EHLO HOME-LAPTOP^M
6< 250-mx.google.com at your service, [41.237.142.142]
6< 250-SIZE 35651584
6< 250-8BITMIME
6< 250-AUTH LOGIN PLAIN
6< 250-ENHANCEDSTATUSCODES
6< 250 PIPELINING
local ip: 192.168.1.243;41538, remote ip:209.85.135.111;465
External SSF: 128
External authentication name: darwish.07@xxxxxxxxx
6> AUTH LOGIN^M
...
6< 235 2.7.0 Accepted
6> MAIL FROM:<darwish.07@xxxxxxxxx>^M
6< 250 2.1.0 OK s10sm5562440mue.8
6> RCPT TO:<darwish.07@xxxxxxxxx>^M
6< 250 2.1.5 OK s10sm5562440mue.8
Updating progress: 0
6> DATA^M
6< 354 Go ahead s10sm5562440mue.8
Updating progress: 38
Updating progress: 86
Updating progress: 111
Updating progress: 129
Updating progress: 178
Updating progress: 196
Updating progress: 239
Updating progress: 267
Updating progress: 313
Updating progress: 314
Updating progress: 324
6> .^M
}}}
mutt -v:
{{{
$ mutt -v
Mutt 1.5.19 (2009-01-05)
<Copyrights boilerplate>
System: Linux 2.6.29 (i686)
ncurses: ncurses 5.6.20071124 (compiled with 5.6)
hcache backend: GDBM version 1.8.3. 10/15/2002 (built Jun 15 2006
21:19:27)
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 +HAVE_WC_FUNCS +HAVE_LANGINFO_CODESET
+HAVE_LANGINFO_YESEXPR
+HAVE_ICONV -ICONV_NONTRANS -HAVE_LIBIDN +HAVE_GETSID +USE_HCACHE
ISPELL="/usr/bin/ispell"
SENDMAIL="/usr/sbin/sendmail"
MAILPATH="/var/mail"
PKGDATADIR="/usr/local//share/mutt"
SYSCONFDIR="/usr/local//etc"
EXECSHELL="/bin/sh"
-MIXMASTER
}}}
--
Comment:
(password removed from debug info!)
I'm not sure what to do here. It looks like mutt has sent the entire
message, including the termination code, and is waiting for google to say
whether or not it has accepted the message. According to this trace, it's
google's SMTP server that's hanging. Probably all socket code needs a
configurable timeout, causing whatever's in progress to abort. There may
be an open bug for that.
--
Ticket URL: <http://dev.mutt.org/trac/ticket/3266#comment:1>
Mutt <http://www.mutt.org/>
The Mutt mail user agent