home *** CD-ROM | disk | FTP | other *** search
/ BMUG Revelations / BMUG Revelations.toast / Utilities / Network / QUE / Basic / quecheck.c < prev    next >
Encoding:
C/C++ Source or Header  |  1989-08-03  |  1.3 KB  |  41 lines  |  [TEXT/MSWD]

  1. /*
  2. ------------------------------------------------------------
  3. Copyright © 1989 Rob Kassel, Mike McCandless and the Massachusetts Institute of Technology
  4.  
  5. Permission to use, copy, modify, and distribute this software and its documentation for any purpose without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the name of M.I.T. not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission.  The authors and M.I.T. make no representations about the suitability of this software for any purpose.  It is provided “as is” without express or implied warranty.
  6. ------------------------------------------------------------
  7. */
  8.  
  9. #include "mail.h"
  10. /*This program just verifies that the online argument is a legitimate username*/
  11.  
  12. main(argc,argv)
  13. int argc;
  14. char *argv[];
  15.  
  16. {
  17. FILE *fp,*popen();
  18. char st[200],st2[200];
  19. char res[200],aCopy[200];
  20.  
  21. if (argc != 2) {
  22.     printf("Usage: %s username\n",argv[0]);
  23.     exit(1);
  24. }
  25.  
  26. strcpy(aCopy,alter(rmSpce(argv[1]),'_'));
  27.  
  28. sprintf(st,"sendmail -bv %s\n",aCopy);
  29. fp = popen(st,"r");
  30.  
  31. fgets(st2,200,fp);
  32.  
  33. if (!strncmp(st2,aCopy,strlen(aCopy)))
  34.     sprintf(res,"Invalid User");
  35. else
  36.     sprintf(res,"Valid User");
  37.  
  38. printf("%s\n\n",res);
  39. pclose(fp);
  40. }
  41.