diff options
-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) #include <netinet/in.h> #include <netdb.h> #include <stdio.h> +#include <pwd.h> #ifdef USG #include <fcntl.h> @@ -427,6 +428,9 @@ popmail (user, outfile) register int i; int mbfi; FILE *mbf; + struct passwd *pw = (struct passwd *) getpwuid (getuid ()); + if (pw == NULL) + fatal ("cannot determine user name"); host = getenv ("MAILHOST"); if (host == NULL) @@ -445,7 +449,7 @@ popmail (user, outfile) } if (pop_command ("USER %s", user) == NOTOK - || pop_command ("RPOP %s", user) == NOTOK) + || pop_command ("RPOP %s", pw->pw_name) == NOTOK) { pop_command ("QUIT"); fatal (Errmsg); |