Logging: support +outgoing_port on defer lines and per-host error lines
[exim.git] / src / src / deliver.c
index f3ae2208a85be40e10e63524dc63c3a52cd9ba54..e1f4e0e293cb69a24a0be0e750f1eb298b4c0ab9 100644 (file)
@@ -1288,9 +1288,17 @@ else if (result == DEFER || result == PANIC)
         US strerror(addr->basic_errno));
 
     if (addr->host_used)
+      {
       s = string_append(s, &size, &ptr, 5,
                        US" H=", addr->host_used->name,
                        US" [",  addr->host_used->address, US"]");
+      if (LOGGING(outgoing_port))
+       {
+       int port = addr->host_used->port;
+       s = string_append(s, &size, &ptr, 2,
+             US":", port == PORT_NONE ? US"25" : string_sprintf("%d", port));
+       }
+      }
 
     if (addr->message)
       s = string_append(s, &size, &ptr, 2, US": ", addr->message);