/[mailutils]/mailutils/mailbox/sendmail.c
ViewVC logotype

Diff of /mailutils/mailbox/sendmail.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.21 by polak, Sun Feb 9 20:39:58 2003 UTC revision 1.22 by gray, Sat Feb 22 22:33:53 2003 UTC
# Line 38  Line 38 
38  #include <mailutils/property.h>  #include <mailutils/property.h>
39  #include <mailutils/stream.h>  #include <mailutils/stream.h>
40  #include <mailutils/url.h>  #include <mailutils/url.h>
41    #include <mailutils/header.h>
42    
43  #include <mailer0.h>  #include <mailer0.h>
44  #include <registrar0.h>  #include <registrar0.h>
# Line 346  sendmail_send_message (mailer_t mailer, Line 347  sendmail_send_message (mailer_t mailer,
347          size_t len = 0;          size_t len = 0;
348          int rc;          int rc;
349          size_t offset = 0;          size_t offset = 0;
350            header_t hdr;
351                    
352          message_get_stream (msg, &stream);          message_get_stream (msg, &stream);
353    
354            if (message_get_header (msg, &hdr)
355                && header_get_value (hdr, MU_HEADER_FCC, NULL, 0, NULL) == 0)
356              {
357                while ((status = stream_readline (stream, buffer, sizeof (buffer),
358                                                  offset, &len)) == 0
359                       && len != 0)
360                  {
361                    if (strncasecmp (buffer, MU_HEADER_FCC,
362                                     sizeof (MU_HEADER_FCC) - 1) == 0)
363                      continue;
364    
365                    if (write (sendmail->fd, buffer, len) == -1)
366                      {
367                        status = errno;
368    
369                        MAILER_DEBUG1 (mailer, MU_DEBUG_TRACE,
370                                       "write() failed: %s\n", strerror (status));
371                        
372                        break;
373                      }
374                    offset += len;
375                    sendmail->offset += len;
376                  }
377              }
378            
379          while ((status = stream_read (stream, buffer, sizeof (buffer),          while ((status = stream_read (stream, buffer, sizeof (buffer),
380                                        offset, &len)) == 0                                        offset, &len)) == 0
381                 && len != 0)                 && len != 0)

Legend:
Removed from v.1.21  
changed lines
  Added in v.1.22

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26