[comp.mail.elm] A whole bunch of bug fixes for elm

daemon@hplabsc.UUCP (05/08/87)

This  is the second of two articles on bug fixes on elm.

The following bugs were fixed:
When running elm non-setgid mail,  when entering elm without specifying
a mail file and your system mailbox was zero length, when exiting
elm you would  have left in /tmp a lock file which would  have to be
deleted by hand.  This was due to an early exit in leave_mbox, which
was only taken when the above conditions  exit.

When running elm with USE_DBM enabled, system aliasing did not work.
This was due to the  fact that the routine "get_connections", which
calculates who your machine can talk to never got  called if  USE_DBM
was enabled.  There was a second USE_DBM related bug.  The name for
a DBM database has the extensions ".dir" and ".pag"  automagically
appended to it by  dbminit.  A stat(2) was being performed on the base
name.  Since this file  probably  didn't exist, it  could cause
failure to call dbminit and give up immediately.  I changed the call to stat(2)
adding the ".pag" extension  to  the  file name  given in  the pathfile
macro.

There was another bug relating to  system name expansion.  The parsing
algorithm could  not handle addresses of the form "(user)@system-name"
Unfortunately, this  was how the alias system command  was passing
the typed in system name.

(Now that I finally have system name expansion from pathalias, I  am
quite impressed.  It  is  an outstanding feature.)

Lastly  there was a bug in how  elm dealt with archived mail.  When sending
mail  via the menu (and  a mail  archive was specified), the sent
letter would be archived.  When sending mail  via "elm -s subject ...",
the mail would  never be archived.  This apparently was feature because
there was an explicit "if" condition to prevent archiving.  I consider
this disconcerting  because  it is contrary to the way UCBmail works.

Following are context diffs based on the  recent  patched release.
Files ending  in .patch are the patched release source files.
	-Steve Baur
{ihnp4,decvax,ucbvax,hplabs}!trwrb!trwspp!spp3!baur
People without college degrees are people too.
-------------------------------------------------------------------------
diff alias.c alias.c.patch

228d227
< 	  get_connections();
229a229
> 	  get_connections();
298c298
< 		        sprintf(buffer, "user@%s", name);
---
> 		        sprintf(buffer, "(user)@%s", name);


diff aliasdb.c aliasdb.c.patch
113d112
< dprint(6, (debugfile, "exand_site:  cryptic = '%s'\n", cryptic));
126,128d124
< 
< dprint(6, (debugfile, "expand_site:  comment = '%s'\n", comment));
< 
140,141d135
< dprint(6, (debugfile, "expand_site:  cryptic = '%s'\n",  cryptic));
< 
149,151c143
< 
< dprint(6, (debugfile, "expand_site:  sitename='%s', cryptic='%s'\n", sitename, cryptic));
< 
---
> 	
287c279
< 	char buf[VERY_LONG_STRING], *p;
---
> 
290,298c282
< 	/* this  is dumb.  DBM uses .dir and .pag extensions */
< 	/* when  we do stat,  append .pag to  it to get the right file */
< #ifdef USE_DBM
< 	sprintf(buf, "%s.pag", pathfile);
< 	p = buf;
< #else
< 	p = pathfile;
< #endif USE_DBM
< 	if (stat(p, &buffer) == -1) {
---
> 	if (stat(pathfile, &buffer) == -1) {
301c285
< 		  p, "init_findnode"));
---
> 		  pathfile, "init_findnode"));


diff leavembox.c leavembox.c.patch
51,53c51
< 	if (message_count == 0) {
< 	  if (mbox_specified == 0)
< 		unlock();	/* should  fix null mailbox bug */
---
> 	if (message_count == 0) 
55d52
< 	}
diff mailmsg2.c mailmsg2.c.patch
209c209
< 	if (auto_cc) 
---
> 	if (auto_cc && !batch) 
-- 
	-Steve Baur
{ihnp4,decvax,ucbvax,hplabs}!trwrb!trwspp!spp3!baur
People without college degrees are people too.