This could have caused "host not given" errors if an empty "host=" was sent
to login process, even though hostip was also sent.
Fixed this in two places, although either one should have been enough.
secs = dir->set->director_user_expire / 2;
str_printfa(str, "%s\tproxy_refresh=%u\t", request->line, secs);
- if (hostname == NULL)
+ if (hostname == NULL || hostname[0] == '\0')
str_printfa(str, "host=%s", net_ip2addr(ip));
else {
str_printfa(str, "host=%s\thostip=%s",
struct mail_host *host;
host = mail_host_add_ip(list, ip, tag_name);
- host->hostname = i_strdup(hostname);
+ if (hostname != NULL && hostname[0] != '\0')
+ host->hostname = i_strdup(hostname);
return host;
}