- log_write(0, LOG_MAIN, "%s [%s]: %s",
- host->name,
- host->address,
- strerror(addr->basic_errno));
- deliver_msglog("%s %s [%s]: %s\n",
- tod_stamp(tod_log),
- host->name,
- host->address,
+ uschar *msg =
+ ((log_extra_selector & LX_outgoing_port) != 0)?
+ string_sprintf("%s [%s]:%d", host->name, host->address,
+ (host->port == PORT_NONE)? 25 : host->port)
+ :
+ string_sprintf("%s [%s]", host->name, host->address);
+ log_write(0, LOG_MAIN, "%s %s", msg, strerror(addr->basic_errno));
+ deliver_msglog("%s %s %s\n", tod_stamp(tod_log), msg,