<<< Date Index >>>     <<< Thread Index >>>

Segmentation fault from mutt-1.5.17 with SMTP



I haven't had time to make much progress on this, but I thought I'd 
present what I've found so far in case someone else might have found 
the same thing.

I've used mutt for years on Unix systems with sendmail.  Now I'm 
having to use a system without a properly configured sendmail so I'm 
trying to use mutt's internal SMTP.  It works fine interactively, 
but when I try to pipe a message to mutt's stdin, I get a 
segmentation fault, e.g.,

   $ echo test | mutt -s test garyjohn
   Looking up mailsvr.spk.agilent.com...
   Connecting to mailsvr.spk.agilent.com...
   Memory fault

I found the proximate problem using gdb:

   (gdb) run mutt -s test garyjohn < /dev/null
   Starting program: /home/garyjohn/src/Linux/mutt-1.5.17-smtp/bin/mutt mutt -s 
test garyjohn < /dev/null
   Detaching after fork from child process 21587.
   Detaching after fork from child process 21588.
   Looking up mailsvr.spk.agilent.com...
   Connecting to mailsvr.spk.agilent.com...

   Program received signal SIGSEGV, Segmentation fault.
   0x080b1f1b in mutt_smtp_send (from=0x0, to=0x928bbd8, cc=0x0, bcc=0x0, 
msgfile=0xbfe50020 "/home/garyjohn/tmp/mutt/mutt-whiffle-3324-21584-2", 
eightbit=0)
       at smtp.c:232
   232         ret = snprintf (buf, sizeof (buf), "MAIL FROM:<%s>",
   (gdb) l
   227         if (( ret = smtp_open (conn)))
   228           break;
   229         FREE (&AuthMechs);
   230     
   231         /* send the sender's address */
   232         ret = snprintf (buf, sizeof (buf), "MAIL FROM:<%s>",
   233                         EnvFrom ? EnvFrom->mailbox : from->mailbox);
   234         if (eightbit && mutt_bit_isset (Capabilities, EIGHTBITMIME))
   235         {
   236           safe_strncat (buf, sizeof (buf), " BODY=8BITMIME", 15);

EnvFrom is 0, so from->mailbox is evaluated, but from is also 0, so
evaluating the NULL from pointer results in the segmentation fault.
The stack backtrace shows that from is 0 when mutt_smtp_send() is
called.

   (gdb) info stack
   #0  0x080b1f1b in mutt_smtp_send (from=0x0, to=0x928bbd8, cc=0x0, bcc=0x0, 
msgfile=0xbfe50020 "/home/garyjohn/tmp/mutt/mutt-whiffle-3324-21584-2", 
       eightbit=0) at smtp.c:232
   #1  0x08096e92 in ci_send_message (flags=32, msg=0x916f0e8, tempfile=0x0, 
ctx=0x0, cur=0x0) at send.c:1011
   #2  0x080759c8 in main (argc=5, argv=0xbfe524b4) at main.c:936

That's as far as I've gotten.  I'll try to make more progress
tomorrow.  Here's the output of "mutt -v".

   Mutt 1.5.17 (2007-11-01)
   Copyright (C) 1996-2007 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.9-42.0.10.EL (i686)
   ncurses: ncurses 5.4.20040724 (compiled with 5.4)
   libiconv: 1.11
   libidn: 0.5.6 (compiled with 0.5.6)
   Compile options:
   -DOMAIN
   +DEBUG
   -HOMESPOOL  -USE_SETGID  +USE_DOTLOCK  -DL_STANDALONE  
   +USE_FCNTL  -USE_FLOCK   -USE_INODESORT   
   -USE_POP  -USE_IMAP  +USE_SMTP  -USE_GSS  -USE_SSL_OPENSSL  -USE_SSL_GNUTLS  
-USE_SASL  +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="/home/garyjohn/src/Linux/mutt-1.5.17-smtp/share/mutt"
   SYSCONFDIR="/home/garyjohn/src/Linux/mutt-1.5.17-smtp/etc"
   EXECSHELL="/bin/sh"
   -MIXMASTER
   To contact the developers, please mail to <mutt-dev@xxxxxxxx>.
   To report a bug, please visit http://bugs.mutt.org/.

   patch-1.5.17.bpm.compose_sender.20080218.txt
   patch-1.5.5.1.gj.sigontop_space_fix.1
   patch-1.5.12.gj.attach_sanitize.1

Regards,
Gary