compat wrapper: don't crash if neither host nor tunnel are specified.
fixes: CCMAIL: 449006@bugs.debian.org
This commit is contained in:
parent
71fce2a622
commit
474923bc6b
|
@ -246,7 +246,7 @@ write_imap_server( FILE *fp, config_t *cfg )
|
||||||
|
|
||||||
if (cfg->tunnel)
|
if (cfg->tunnel)
|
||||||
nfasprintf( (char **)&cfg->old_server_name, "tunnel%d", ++tunnels );
|
nfasprintf( (char **)&cfg->old_server_name, "tunnel%d", ++tunnels );
|
||||||
else {
|
else if (cfg->host) {
|
||||||
if (sscanf( cfg->host, "%d.%d.%d.%d", &a1, &a2, &a3, &a4 ) == 4)
|
if (sscanf( cfg->host, "%d.%d.%d.%d", &a1, &a2, &a3, &a4 ) == 4)
|
||||||
hl = nfsnprintf( buf, sizeof(buf), "%s", cfg->host );
|
hl = nfsnprintf( buf, sizeof(buf), "%s", cfg->host );
|
||||||
else {
|
else {
|
||||||
|
@ -270,6 +270,9 @@ write_imap_server( FILE *fp, config_t *cfg )
|
||||||
cfg->old_server_name = nfstrdup( buf );
|
cfg->old_server_name = nfstrdup( buf );
|
||||||
cfg->old_servers = 1;
|
cfg->old_servers = 1;
|
||||||
gotsrv: ;
|
gotsrv: ;
|
||||||
|
} else {
|
||||||
|
fprintf( stderr, "ERROR: Neither host nor tunnel specified for mailbox %s.\n", cfg->path );
|
||||||
|
exit( 1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cfg->user)
|
if (cfg->user)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user