diff options
-rw-r--r-- | fetchmail.c | 15 | ||||
-rw-r--r-- | fetchmail.h | 6 | ||||
-rw-r--r-- | options.c | 11 | ||||
-rw-r--r-- | pop2.c | 2 | ||||
-rw-r--r-- | pop3.c | 12 | ||||
-rw-r--r-- | rcfile_y.y | 2 |
6 files changed, 18 insertions, 30 deletions
diff --git a/fetchmail.c b/fetchmail.c index de95b785..9d39d904 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -277,10 +277,7 @@ int showversioninfo() int dump_options (options) struct optrec *options; { - if (!options->loginid[0]) - printf(" No password set\n"); - else - printf(" Username = '%s'\n", options->username); + printf(" Username = '%s'\n", options->remotename); printf(" Password = '%s'\n", options->password); printf(" Protocol is "); @@ -551,15 +548,7 @@ struct optrec *options; /* punch in a null terminator */ if (*argp != '\0') *(argp++) = '\0'; - - /* check for macros */ - if (strcmp(mda_argv[argi],"$u") == 0) - mda_argv[argi] = - strcpy((char *) malloc(strlen(options->loginid)+1),options->loginid); - else - ; /* no macros to expand */ - - } + } mda_argv[argi] = (char *) 0; } diff --git a/fetchmail.h b/fetchmail.h index c825f770..a73689de 100644 --- a/fetchmail.h +++ b/fetchmail.h @@ -56,9 +56,9 @@ struct optrec { int fetchall; int flush; int output; - char loginid [USERNAMELEN]; char *poprcfile; - char username [USERNAMELEN]; + char localname [USERNAMELEN]; + char remotename [USERNAMELEN]; char password [PASSWORDLEN]; #if defined(HAVE_APOP_SUPPORT) char digest [DIGESTLEN]; @@ -73,7 +73,7 @@ struct optrec { struct prc_server { char *server; int protocol; - char *username; + char *remotename; char *password; char *remotefolder; char *userfolder; @@ -189,7 +189,7 @@ struct optrec *options; break; case 'u': case LA_USERNAME: - strncpy(options->username,optarg,sizeof(options->username)-1); + strncpy(options->remotename,optarg,sizeof(options->remotename)-1); break; case 'o': case LA_LOCALFILE: @@ -288,8 +288,6 @@ struct optrec *options; fprintf(stderr,"No passwd entry for uid %d\n",uid); return(-1); } - /* save the login name for delivery use */ - strcpy(options->loginid,pw->pw_name); options->whichpop = DEF_PROTOCOL; @@ -299,16 +297,17 @@ struct optrec *options; options->keep = 0; #endif - strcpy(options->username,pw->pw_name); + strcpy(options->localname,pw->pw_name); + strcpy(options->remotename,pw->pw_name); #if defined(USERFOLDER) && defined(HAVE_FLOCK) options->output = TO_FOLDER; - sprintf(options->userfolder, USERFOLDER, options->username); + sprintf(options->userfolder, USERFOLDER, pw->pw_name); #else options->output = TO_MDA; #endif - (void) sprintf(options->mda, DEF_MDA, options->username); + (void) sprintf(options->mda, DEF_MDA, options->localname); options->poprcfile = (char *) xmalloc(strlen(pw->pw_dir)+strlen(POPRC_NAME)+2); @@ -108,7 +108,7 @@ struct optrec *options; } /* log the user onto the server */ - POP2_sendHELO(options->username,options->password,socket); + POP2_sendHELO(options->remotename,options->password,socket); if ((number = POP2_stateNMBR(socket)) < 0) { POP2_quit(socket); status = PS_AUTHFAIL; @@ -299,9 +299,9 @@ int socket; switch (options->whichpop) { case P_POP3: - SockPrintf(socket,"USER %s\r\n",options->username); + SockPrintf(socket,"USER %s\r\n",options->remotename); if (outlevel == O_VERBOSE) - fprintf(stderr,"> USER %s\n",options->username); + fprintf(stderr,"> USER %s\n",options->remotename); if (POP3_OK(buf,socket) != 0) goto badAuth; @@ -316,9 +316,9 @@ int socket; #if defined(HAVE_APOP_SUPPORT) case P_APOP: SockPrintf(socket,"APOP %s %s\r\n", - options->username, options->digest); + options->remotename, options->digest); if (outlevel == O_VERBOSE) - fprintf(stderr,"> APOP %s %s\n",options->username, options->digest); + fprintf(stderr,"> APOP %s %s\n",options->remotename, options->digest); if (POP3_OK(buf,socket) != 0) goto badAuth; break; @@ -326,11 +326,11 @@ int socket; #if defined(HAVE_RPOP_SUPPORT) case P_RPOP: - SockPrintf(socket, "RPOP %s\r\n", options->username); + SockPrintf(socket, "RPOP %s\r\n", options->remotename); if (POP3_OK(buf,socket) != 0) goto badAuth; if (outlevel == O_VERBOSE) - fprintf(stderr,"> RPOP %s %s\n",options->username); + fprintf(stderr,"> RPOP %s %s\n",options->remotename); break; #endif /* HAVE_RPOP_SUPPORT */ @@ -60,7 +60,7 @@ server_options: serv_option_clause serv_option_clause: KW_PROTOCOL proto {prc_setproto($2);} - | KW_USERNAME PARAM_STRING {prc_setusername($2);} + | KW_USERNAME PARAM_STRING {prc_remotename($2);} | KW_PASSWORD PARAM_STRING {prc_setpassword($2);} | KW_REMOTEFOLDER PARAM_STRING {prc_setremote($2);} | KW_LOCALFOLDER PARAM_STRING {prc_setlocal($2);} |