Index: usr.sbin/syslogd/syslogd.8 =================================================================== --- usr.sbin/syslogd/syslogd.8 +++ usr.sbin/syslogd/syslogd.8 @@ -282,6 +282,9 @@ If specified twice, no network socket will be opened at all, which also disables logging to remote machines. +.It Fl t +Suppresses the "Forwarded from : " string added to the +beginning of the syslog message that is forwarded to a remote log host. .It Fl T Always use the local time and date for messages received from the network, instead of the timestamp field supplied in the message by the remote host. Index: usr.sbin/syslogd/syslogd.c =================================================================== --- usr.sbin/syslogd/syslogd.c +++ usr.sbin/syslogd/syslogd.c @@ -312,6 +312,7 @@ struct allowedpeer *AllowedPeers; /* List of allowed peers */ static int NumAllowed; /* Number of entries in AllowedPeers */ static int RemoteAddDate; /* Always set the date on remote messages */ +static int RemoteAddForwardedFrom = 1; /* Add "Forwarded From" for forwarded remote messages */ static int UniquePriority; /* Only log specified priority? */ static int LogFacPri; /* Put facility and priority in log message: */ @@ -405,7 +406,7 @@ STAILQ_INIT(&hqueue); - while ((ch = getopt(argc, argv, "468Aa:b:cCdf:Fkl:m:nNop:P:sS:Tuv")) + while ((ch = getopt(argc, argv, "468Aa:b:cCdf:Fkl:m:nNop:P:sS:tTuv")) != -1) switch (ch) { case '4': @@ -518,6 +519,9 @@ errx(1, "%s path too long, exiting", optarg); funix_secure.name = optarg; break; + case 't': /* supress "Forwarded from" for forwarded remote messages */ + RemoteAddForwardedFrom = 0; + break; case 'T': RemoteAddDate = 1; break; @@ -1270,7 +1274,7 @@ dprintf(" %s\n", f->f_un.f_forw.f_hname); } /* check for local vs remote messages */ - if (strcasecmp(f->f_prevhost, LocalHostName)) + if (RemoteAddForwardedFrom && strcasecmp(f->f_prevhost, LocalHostName)) l = snprintf(line, sizeof line - 1, "<%d>%.15s Forwarded from %s: %s", f->f_prevpri, (char *)iov[0].iov_base,