imap/src/mailutil/mailutil.c
/* Get user name and password for this host
 * Accepts: parse of network mailbox name
 *	    where to return user name
 *	    where to return password
 *	    trial count
 */
Get user name and password for this host
Accepts: parse of network mailbox name
where to return user name
where to return password
trial count
Get user name and password for this host Accepts : parse of network mailbox name where to return user name where to return password trial count
void mm_login (NETMBX *mb,char *username,char *password,long trial)
{
  char *s,tmp[MAILTMPLEN];
  sprintf (s = tmp,"{%s/%s",mb->host,mb->service);
  if (*mb->user) sprintf (tmp+strlen (tmp),"/user=%s",
			  strcpy (username,mb->user));
  if (*mb->authuser) sprintf (tmp+strlen (tmp),"/authuser=%s",mb->authuser);
  if (*mb->user) strcat (s = tmp,"} password:");
  else {
    printf ("%s} username: ",tmp);
    fgets (username,NETMAXUSER-1,stdin);
    username[NETMAXUSER-1] = '\0';
    if (s = strchr (username,'\n')) *s = '\0';
    s = "password: ";
  }
  if(strlen (s = getpass (s)) < MAILTMPLEN) strcpy (password,s);
}
void mm_login ( NETMBX * mb , char * username , char * password , long trial ) { char * s , tmp [ MAILTMPLEN ] ; sprintf ( s = tmp , " " , mb -> host , mb -> service ) ; if ( * mb -> user ) sprintf ( tmp + strlen ( tmp ) , " " , strcpy ( username , mb -> user ) ) ; if ( * mb -> authuser ) sprintf ( tmp + strlen ( tmp ) , " " , mb -> authuser ) ; if ( * mb -> user ) strcat ( s = tmp , " " ) ; else { printf ( " " , tmp ) ; fgets ( username , NETMAXUSER - 1 , stdin ) ; username [ NETMAXUSER - 1 ] = ' \0 ' ; if ( s = strchr ( username , ' \n ' ) ) * s = ' \0 ' ; s = " " ; } if ( strlen ( s = getpass ( s ) ) < MAILTMPLEN ) strcpy ( password , s ) ; }
Get user name and password for this host
 Accepts: parse of network mailbox name
          where to return user name
          where to return password
          trial count
Get user name and password for this host Accepts : parse of network mailbox name where to return user name where to return password trial count