comparison lib-src/movemail.c @ 634:52d0ff659265

*** empty log message ***
author Richard M. Stallman <rms@gnu.org>
date Thu, 07 May 1992 20:13:17 +0000
parents 63a8e7b3c547
children 62dd28940dc6
comparison
equal deleted inserted replaced
633:379b94c9f29e 634:52d0ff659265
390 390
391 #include <sys/socket.h> 391 #include <sys/socket.h>
392 #include <netinet/in.h> 392 #include <netinet/in.h>
393 #include <netdb.h> 393 #include <netdb.h>
394 #include <stdio.h> 394 #include <stdio.h>
395 #include <pwd.h>
395 396
396 #ifdef USG 397 #ifdef USG
397 #include <fcntl.h> 398 #include <fcntl.h>
398 /* Cancel substitutions made by config.h for Emacs. */ 399 /* Cancel substitutions made by config.h for Emacs. */
399 #undef open 400 #undef open
425 int nmsgs, nbytes; 426 int nmsgs, nbytes;
426 char response[128]; 427 char response[128];
427 register int i; 428 register int i;
428 int mbfi; 429 int mbfi;
429 FILE *mbf; 430 FILE *mbf;
431 struct passwd *pw = (struct passwd *) getpwuid (getuid ());
432 if (pw == NULL)
433 fatal ("cannot determine user name");
430 434
431 host = getenv ("MAILHOST"); 435 host = getenv ("MAILHOST");
432 if (host == NULL) 436 if (host == NULL)
433 { 437 {
434 fatal ("no MAILHOST defined"); 438 fatal ("no MAILHOST defined");
443 { 447 {
444 fatal (response); 448 fatal (response);
445 } 449 }
446 450
447 if (pop_command ("USER %s", user) == NOTOK 451 if (pop_command ("USER %s", user) == NOTOK
448 || pop_command ("RPOP %s", user) == NOTOK) 452 || pop_command ("RPOP %s", pw->pw_name) == NOTOK)
449 { 453 {
450 pop_command ("QUIT"); 454 pop_command ("QUIT");
451 fatal (Errmsg); 455 fatal (Errmsg);
452 } 456 }
453 457