Thread View: comp.bugs.4bsd
1 messages
1 total messages
Started by Neil Rickert
Thu, 20 Jun 1991 14:37
/bin/mail incorrectly deletes the "From: " header.
Author: Neil Rickert
Date: Thu, 20 Jun 1991 14:37
Date: Thu, 20 Jun 1991 14:37
65 lines
2366 bytes
2366 bytes
PROBLEM:
/bin/mail will, under certain circumstances, delete an existing
"From:" header.
REPEAT BY:
/bin/mail -r $USER -d $USER <<EOF
From: $USER (Just testing)
To: $USER
Test
EOF
Observe that in the mail delivered to your mailbox, the "From:"
header has been discarded.
ANALYSIS:
/bin/mail should be testing for the 5 character string "From " instead
of the 4 character string "From".
IMPLICATIONS:
Under certain circumstances, the "From:" header is discarded and
regenerated by sendmail. Depending on the order of the header
definition, this may result in "From:" preceding the "Received:"
headers. If it is the first header, /bin/mail may delete it.
WORKAROUND:
Make sure your local mailer definition in 'sendmail.cf' includes the
'R' flag to generate a "Received:" header. Send yourself mail with the
command: echo Testing | /usr/lib/sendmail $USER
Inspect the mail, and make sure that the "Received:" header precedes the
"From:" header. If not, rearrange the header definitions in sendmail.cf
appropriately.
PATCH:
*** binmail.c.orig Fri Nov 30 14:22:31 1990
--- binmail.c Thu Jun 20 06:22:45 1991
***************
*** 481,487 ****
usage();
truename = argv[1];
fgets(line, LSIZE, stdin);
! if (strncmp("From", line, 4) == 0)
line[0] = '\0';
argv++;
argc--;
--- 481,487 ----
usage();
truename = argv[1];
fgets(line, LSIZE, stdin);
! if (strncmp(from, line, 5) == 0)
line[0] = '\0';
argv++;
argc--;
--
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
Neil W. Rickert, Computer Science <rickert@cs.niu.edu>
Northern Illinois Univ.
DeKalb, IL 60115 +1-815-753-6940
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads