Plan 9 from Bell Labs’s /usr/web/sources/contrib/uriel/changes/2005/1118/2

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


Write regular expression errors to log.
 [rsc] --rw-rw-r-- M 55859 glenda sys 6386 Nov 18 11:26 sys/src/cmd/upas/send/rewrite.c
	/n/sourcesdump/2005/1118/plan9/sys/src/cmd/upas/send/rewrite.c:282,287 - 
	/n/sourcesdump/2005/1119/plan9/sys/src/cmd/upas/send/rewrite.c:282,289
	  regerror(char* s)
	  {
	  	fprint(2, "rewrite: %s\n", s);
	+ 	/* make sure the message is seen locally */
	+ 	syslog(0, "mail", "error in rewrite: %s", s);
	  }
	  
	  extern void
 [rsc] --rw-rw-r-- M 55859 glenda sys 31097 Nov 18 11:26 sys/src/cmd/upas/smtp/smtpd.c
	/n/sourcesdump/2005/1118/plan9/sys/src/cmd/upas/smtp/smtpd.c:157,163 - 
	/n/sourcesdump/2005/1119/plan9/sys/src/cmd/upas/smtp/smtpd.c:157,163
	  
	  	if(debug){
	  		close(2);
	- 		snprint(buf, sizeof(buf), "%s/smtpd", UPASLOG);
	+ 		snprint(buf, sizeof(buf), "%s/smtpd.db", UPASLOG);
	  		if (open(buf, OWRITE) >= 0) {
	  			seek(2, 0, 2);
	  			fprint(2, "%d smtpd %s\n", getpid(), thedate());
	/n/sourcesdump/2005/1118/plan9/sys/src/cmd/upas/smtp/smtpd.c:1221,1226 - 
	/n/sourcesdump/2005/1119/plan9/sys/src/cmd/upas/smtp/smtpd.c:1221,1236
	  		}
	  		reply("%d mail process terminated abnormally\r\n", code);
	  	} else {
	+ 		/*
	+ 		 * if a message appeared on stderr, despite good status,
	+ 		 * log it.  this can happen if rewrite.in contains a bad
	+ 		 * r.e., for example.
	+ 		 */
	+ 		if(*s_to_c(err))
	+ 			syslog(0, "smtpd",
	+ 				"%s returned good status, but said: %s",
	+ 				s_to_c(mailer), s_to_c(err));
	+ 
	  		if(filterstate == BLOCKED)
	  			reply("554 we believe this is spam.  we don't accept it.\r\n");
	  		else


Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.