[1382] in Moira

home help back first fref pref prev next nref lref last post

Re: reject addresses ending in @

daemon@ATHENA.MIT.EDU (Garry Zacheiss)
Mon Feb 21 00:39:51 2000

Message-Id: <200002210539.AAA13960@e40-spare-ss20.mit.edu>
To: Jonathon Weiss <jweiss@MIT.EDU>
cc: moiradev@MIT.EDU
In-Reply-To: Your message of "Sun, 20 Feb 2000 23:35:12 EST."
             <200002210435.XAA11378@vorpal-blade.mit.edu> 
Date: Mon, 21 Feb 2000 00:39:46 -0500
From: Garry Zacheiss <zacheiss@MIT.EDU>

>> In the com_err call you should use p rather than address for consistancy
>> with the surrounding code.

   At that point, p is the address with the @ sign and everything after
stripped off, so the error message if we used p would take the form:

moira: The address "zacheiss" is invalid.

in response to the input "zacheiss@", which seems wrong.

>> I'd also like to see the error message be more expicit about what the
>> problem is.  Maybe something like "address %s doesn't contain a host
>> name."

   Sure.  How's this:

Index: pobox.c
===================================================================
RCS file: /afs/athena.mit.edu/astaff/project/moiradev/repository//moira/clients/lib/pobox.c,v
retrieving revision 1.1
diff -c -r1.1 pobox.c
*** pobox.c	1999/05/13 18:52:28	1.1
--- pobox.c	2000/02/21 05:33:09
***************
*** 56,62 ****
  	  goto cleanup;
  	}
  
!       machine = canonicalize_hostname(strdup(m));
        switch (potype(machine))
  	{
  	case POTYPE_POP:
--- 56,72 ----
  	  goto cleanup;
  	}
  
!       if (strlen(m) > 0)
! 	{
! 	  machine = canonicalize_hostname(strdup(m));
! 	}
!       else
! 	{
! 	  com_err(whoami, 0, "No hostname in address \"%s\".", address);
! 	  status = MRCL_REJECT;
! 	  goto cleanup;
! 	}
!       
        switch (potype(machine))
  	{
  	case POTYPE_POP:

home help back first fref pref prev next nref lref last post