don't crash in imap driver when Host is not specified.

This commit is contained in:
Oswald Buddenhagen 2006-05-28 16:03:52 +00:00
parent c8275e2aa7
commit 4bf58c3e97

View File

@ -1349,19 +1349,19 @@ imap_open_store( store_conf_t *conf,
info ("Logging in...\n"); info ("Logging in...\n");
if (!srvc->user) { if (!srvc->user) {
error( "Skipping server %s, no user\n", srvc->host ); error( "Skipping account %s, no user\n", srvc->name );
goto bail; goto bail;
} }
if (!srvc->pass) { if (!srvc->pass) {
char prompt[80]; char prompt[80];
sprintf( prompt, "Password (%s@%s): ", srvc->user, srvc->host ); sprintf( prompt, "Password (%s): ", srvc->name );
arg = getpass( prompt ); arg = getpass( prompt );
if (!arg) { if (!arg) {
perror( "getpass" ); perror( "getpass" );
exit( 1 ); exit( 1 );
} }
if (!*arg) { if (!*arg) {
error( "Skipping account %s@%s, no password\n", srvc->user, srvc->host ); error( "Skipping account %s, no password\n", srvc->name );
goto bail; goto bail;
} }
/* /*
@ -1386,7 +1386,7 @@ imap_open_store( store_conf_t *conf,
#endif #endif
{ {
if (CAP(NOLOGIN)) { if (CAP(NOLOGIN)) {
error( "Skipping account %s@%s, server forbids LOGIN\n", srvc->user, srvc->host ); error( "Skipping account %s, server forbids LOGIN\n", srvc->name );
goto bail; goto bail;
} }
#if HAVE_LIBSSL #if HAVE_LIBSSL