Subject: misc/644: /usr/bin/mail cannot read mail files produced by Solaris 2.3
To: None <gnats-admin@sun-lamp.cs.berkeley.edu>
From: Jan Sparud <sparud@cs.chalmers.se>
List: netbsd-bugs
Date: 12/16/1994 14:50:06
>Number:         644
>Category:       misc
>Synopsis:       /usr/bin/mail cannot read mail files produced by Solaris 2.3
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people (Misc Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Dec 16 14:50:04 1994
>Originator:     Jan Sparud
>Organization:
"	Chalmers University iof Technology"
>Release:        NetBSD-current
>Environment:
System: NetBSD butthead 1.0A NetBSD 1.0A (SB16) #49: Thu Dec 1 18:21:49 MET 1994 sparud@butthead:/home/beavis/usr/src/sys/arch/i386/compile/SB16 i386


>Description:
	/usr/bin/mail cannot read mail files produced by Solaris 2.3
	because of different time formats. (The NetBSD/i386 machine nfs-
	mounts the mail directory from the Sun). On the "From" line 
	Solaris writes the time string as hh:mm, NetBSD /usr/bin/mail 
	wants hh:mm:ss .
	
	RFC822 says the hour format should be:
	     hour        =  2DIGIT ":" 2DIGIT [":" 2DIGIT]
                                                 ; 00:00:00 - 23:59:59
	so the seconds are optional. Solaris omits them, but NetBSD mail
	demands them.

>How-To-Repeat:
	butthead(84)from
	From owner-source-changes@NetBSD.ORG Fri Dec 16 23:24 MET 1994
	From owner-netbsd-help@NetBSD.ORG Fri Dec 16 23:36 MET 1994
	butthead(85)/usr/bin/mail
	No mail for sparud
	
>Fix:
*** /usr/src/usr.bin/mail/head.c.orig	Fri Dec 16 23:23:12 1994
--- /usr/src/usr.bin/mail/head.c	Fri Dec 16 23:23:18 1994
***************
*** 170,183 ****
   */
  
  char ctype[] = "Aaa Aaa O0 00:00:00 0000";
  char tmztype[] = "Aaa Aaa O0 00:00:00 AAA 0000";
  
  int
  isdate(date)
  	char date[];
  {
  
! 	return cmatch(date, ctype) || cmatch(date, tmztype);
  }
  
  /*
--- 170,187 ----
   */
  
  char ctype[] = "Aaa Aaa O0 00:00:00 0000";
+ char ctype_without_secs[] = "Aaa Aaa O0 00:00 0000";
  char tmztype[] = "Aaa Aaa O0 00:00:00 AAA 0000";
+ char tmztype_without_secs[] = "Aaa Aaa O0 00:00 AAA 0000";
  
  int
  isdate(date)
  	char date[];
  {
  
! 	return cmatch(date, ctype_without_secs) || 
! 	       cmatch(date, tmztype_without_secs) || 
! 	       cmatch(date, ctype) || cmatch(date, tmztype);
  }
  
  /*

>Audit-Trail:
>Unformatted: