20 |
|
|
21 |
#define NO_SHORTNAMES |
#define NO_SHORTNAMES |
22 |
#define _XOPEN_SOURCE 500 /* for cuserid */ |
#define _XOPEN_SOURCE 500 /* for cuserid */ |
23 |
#include <config.h> |
|
24 |
|
#ifdef HAVE_CONFIG_H |
25 |
|
#include "config.h" |
26 |
|
#endif |
27 |
|
|
28 |
#if defined (BSD_SYSTEM) && !defined (BSD4_1) && !defined (USE_FAKEMAIL) |
#if defined (BSD_SYSTEM) && !defined (BSD4_1) && !defined (USE_FAKEMAIL) |
29 |
/* This program isnot used in BSD, so just avoid loader complaints. */ |
/* This program isnot used in BSD, so just avoid loader complaints. */ |
85 |
struct header_record *previous; |
struct header_record *previous; |
86 |
}; |
}; |
87 |
typedef struct header_record *header; |
typedef struct header_record *header; |
88 |
|
|
89 |
struct stream_record |
struct stream_record |
90 |
{ |
{ |
91 |
FILE *handle; |
FILE *handle; |
206 |
} |
} |
207 |
|
|
208 |
/* Read a line of text from `stream' into `linebuffer'. |
/* Read a line of text from `stream' into `linebuffer'. |
209 |
* Return the length of the line. |
Return the length of the line. */ |
|
*/ |
|
210 |
|
|
211 |
long |
long |
212 |
readline (linebuffer, stream) |
readline (linebuffer, stream) |
621 |
*where = '\0'; |
*where = '\0'; |
622 |
return; |
return; |
623 |
} |
} |
624 |
|
|
625 |
/* Read lines from the input until we get a blank line. |
/* Read lines from the input until we get a blank line. |
626 |
Create a list of `header' objects, one for each header field, |
Create a list of `header' objects, one for each header field, |
627 |
each of which points to a list of `line_list' objects, |
each of which points to a list of `line_list' objects, |
628 |
one for each line in that field. |
one for each line in that field. |
629 |
Continuation lines are grouped in the headers they continue. */ |
Continuation lines are grouped in the headers they continue. */ |
630 |
|
|
631 |
header |
header |
632 |
read_header () |
read_header () |
633 |
{ |
{ |
727 |
command_line = alloc_string (name_length + args_size (the_header)); |
command_line = alloc_string (name_length + args_size (the_header)); |
728 |
strcpy (command_line, mail_program_name); |
strcpy (command_line, mail_program_name); |
729 |
parse_header (the_header, &command_line[name_length]); |
parse_header (the_header, &command_line[name_length]); |
730 |
|
|
731 |
the_pipe = popen (command_line, "w"); |
the_pipe = popen (command_line, "w"); |
732 |
if (the_pipe == ((FILE *) NULL)) |
if (the_pipe == ((FILE *) NULL)) |
733 |
fatal ("cannot open pipe to real mailer"); |
fatal ("cannot open pipe to real mailer"); |