enable the old account naming scheme to deal with duplicated ip

addresses.
this is not incompatible - previously, it would just create garbage.
This commit is contained in:
Oswald Buddenhagen 2006-06-05 11:59:51 +00:00
parent aea4be19e3
commit 9b7c09e4b6

View File

@ -248,7 +248,7 @@ write_imap_server( FILE *fp, config_t *cfg )
nfasprintf( (char **)&cfg->old_server_name, "tunnel%d", ++tunnels ); nfasprintf( (char **)&cfg->old_server_name, "tunnel%d", ++tunnels );
else { else {
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)
cfg->old_server_name = nfstrdup( cfg->host ); hl = nfsnprintf( buf, sizeof(buf), "%s", cfg->host );
else { else {
p = strrchr( cfg->host, '.' ); p = strrchr( cfg->host, '.' );
if (!p) if (!p)
@ -259,6 +259,7 @@ write_imap_server( FILE *fp, config_t *cfg )
if (p2) if (p2)
hl = sprintf( buf, "%s", p2 + 1 ); hl = sprintf( buf, "%s", p2 + 1 );
} }
}
if (boxes) /* !o2o */ if (boxes) /* !o2o */
for (pbox = boxes; pbox != cfg; pbox = pbox->next) for (pbox = boxes; pbox != cfg; pbox = pbox->next)
if (!memcmp( pbox->server_name, buf, hl + 1 )) { if (!memcmp( pbox->server_name, buf, hl + 1 )) {
@ -269,7 +270,6 @@ write_imap_server( FILE *fp, config_t *cfg )
cfg->old_servers = 1; cfg->old_servers = 1;
gotsrv: ; gotsrv: ;
} }
}
if (cfg->user) if (cfg->user)
nfsnprintf( ubuf, sizeof(ubuf), "%s@", cfg->user ); nfsnprintf( ubuf, sizeof(ubuf), "%s@", cfg->user );