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

Re: mutt/2094: ESMTP patch: newline conversion and faulty error checking



The following reply was made to PR mutt/2094; it has been noted by GNATS.

From: TAKAHASHI Tamotsu <ttakah@xxxxxxxxxxxxxxxxx>
To: wildenhues@xxxxxxxxxxxxxxx, bug-any@xxxxxxxxxxxxx
Cc: 
Subject: Re: mutt/2094: ESMTP patch: newline conversion and faulty error 
checking
Date: Tue, 27 Sep 2005 19:48:07 +0900

 --fdj2RfSjLxBAspz7
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 > >Number:         2094
 > >Notify-List:    
 > >Category:       mutt
 > >Synopsis:       ESMTP patch: newline conversion and faulty error checking
 
 > >Release:        CVS HEAD + patch-1.5.11.bc.smtp.10
 
 > >Description:
 > The ESMTP patch proposed for mutt writes out the mail
 > header+body with plain \n instead of \r\n.  qmail does
 > not accept it.  Snippet from strace output:
 (snip)
 
 I think Mutt-smtp currently writes exactly what fgets reads.
 Here is an untested patch.
 
 
 > After the send failure, I can edit/postpone the message,
 > but it is also wrongly stored in Fcc.
 
 Mutt saves FCC _before_ sending a message.
 If FCC fails, mutt does not try to send it.
 
 -- 
 tamo
 
 --fdj2RfSjLxBAspz7
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: attachment; filename="patch-1.5.11smtp.tamo.eol.1"
 
 diff -r 1506eb0d5f6e smtp.c
 --- a/smtp.c   Sat Sep 24 21:57:25 2005
 +++ b/smtp.c   Tue Sep 27 19:41:51 2005
 @@ -144,6 +144,7 @@
    progress_t progress;
    struct stat st;
    int r;
 +  size_t buflen;
  
    fp = fopen (msgfile, "r");
    if (!fp)
 @@ -170,6 +171,9 @@
    
    while (fgets (buf, sizeof (buf), fp))
    {
 +    buflen = mutt_strlen (buf);
 +    if (buflen && buf[buflen] == '\n' && buf[buflen - 1] != '\r')
 +      snprintf (buf + buflen, sizeof (buf) - buflen, "\r\n");
      if (buf[0] == '.')
      {
        if (mutt_socket_write_d (conn, ".", 3) == -1)
 
 --fdj2RfSjLxBAspz7--