diff options
Diffstat (limited to 'lib-src')
| -rw-r--r-- | lib-src/movemail.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib-src/movemail.c b/lib-src/movemail.c index de766e6d609..271346a86a8 100644 --- a/lib-src/movemail.c +++ b/lib-src/movemail.c | |||
| @@ -392,6 +392,7 @@ xmalloc (size) | |||
| 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> |
| @@ -427,6 +428,9 @@ popmail (user, outfile) | |||
| 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) |
| @@ -445,7 +449,7 @@ popmail (user, outfile) | |||
| 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); |