[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bad message-id? [when running multiple routers]



  From: Steve Kotsopoulos <steve@ecf.toronto.edu>
  Date: 	Tue, 13 Oct 1992 14:09:40 -0400
  
  I got the following message from another sysadmin, but I find it hard to
  believe that zmailer would break the rules of rfc822. Usually when this happens
  the real cause of the problem is that the remote site is running a version of
  sendmail that does not conform to the rfc's.
  
  I haven't read the mail rfc's though, so who is "doing the right thing"?
  
  > Date:	Sat, 10 Oct 1992 16:47:50 -0400
  > Subject: bad message-id
  > To:	postmaster@ecf.toronto.edu
  > 
  > Your site "skule.ecf.toronto.edu" is generating bad message-id headers in
  > outgoing mail, such as:
  > 
  > 	<92Oct9.153520edt.4764(3)@skule.ecf.toronto.edu>
  > 			      ^ ^
  > 				broken
  > 
  > This isn't RFC822-conformant, so a fix would be appreciated to prevent more
  > messages bouncing.

It really is zmailer's fault.  When you run multiple routers, the
message-id contains the filename from the router directory, but
message-ids cannot contain unquoted parens.

Here is a fix for router/functions.c:

*** 1.2	1992/08/06 16:54:27
--- 1.3	1992/09/28 20:41:32
***************
*** 524,530 ****
  
  	if (router_id) {
  		len = strlen(filename);
! 		if (filename[len - 1] == ')' && strchr(filename, '(') != NULL)
  			return;	/* an already locked message file */
  		if (blen == 0) {
  			blen = 100;
--- 524,530 ----
  
  	if (router_id) {
  		len = strlen(filename);
! 		if (strchr(filename, '-') != NULL)
  			return;	/* an already locked message file */
  		if (blen == 0) {
  			blen = 100;
***************
*** 534,540 ****
  			blen = 2 * blen;
  			buf = (char *)realloc(buf, blen);
  		}
! 		sprintf(buf, "%s(%d)", filename, router_id);
  		if (erename(filename, buf) < 0)
  			return;	/* something is wrong, erename() complains */
  		filename = buf;
--- 534,540 ----
  			blen = 2 * blen;
  			buf = (char *)realloc(buf, blen);
  		}
! 		sprintf(buf, "%s-%d", filename, router_id);
  		if (erename(filename, buf) < 0)
  			return;	/* something is wrong, erename() complains */
  		filename = buf;

Also, there is a logic error in functions.c, which causes some files to
be ignored if your router dies.  On restart, it ignores files.  Another
patch, again to router/functions.c:

*** 1.3	1992/09/28 20:41:32
--- 1.4	1992/10/13 18:18:26
***************
*** 523,544 ****
  	extern void free_gensym();
  
  	if (router_id) {
  		len = strlen(filename);
! 		if (strchr(filename, '-') != NULL)
! 			return;	/* an already locked message file */
! 		if (blen == 0) {
! 			blen = 100;
! 			buf = (char *)malloc(blen);
  		}
! 		while (len + 12 > blen) {
! 			blen = 2 * blen;
! 			buf = (char *)realloc(buf, blen);
  		}
- 		sprintf(buf, "%s-%d", filename, router_id);
- 		if (erename(filename, buf) < 0)
- 			return;	/* something is wrong, erename() complains */
- 		filename = buf;
- 		/* message file is now "file(#)" and belongs to this process */
  	}
  
  	gensym = 1;
--- 523,555 ----
  	extern void free_gensym();
  
  	if (router_id) {
+ 		char *p;
+ 
  		len = strlen(filename);
! 		if ((p=strchr(filename, '-')) != NULL) { /* message file is "file-#" */
! 			if (router_id != atoi(p+1)) {
! 				/*
! 				 * an already locked message file,
! 				 * belonging to another process
! 				 */
! 				return;
! 			}
  		}
! 		else {
! 			if (blen == 0) {
! 				blen = 100;
! 				buf = (char *)malloc(blen);
! 			}
! 			while (len + 12 > blen) {
! 				blen = 2 * blen;
! 				buf = (char *)realloc(buf, blen);
! 			}
! 			sprintf(buf, "%s-%d", filename, router_id);
! 			if (erename(filename, buf) < 0)
! 				return;	/* something is wrong, erename() complains */
! 			filename = buf;
! 			/* message file is now "file-#" and belongs to this process */
  		}
  	}
  
  	gensym = 1;