Best practice to tail a log and start it as service using rc.d scripts

Christoph Moench-Tegeder cmt at
Mon Jul 3 21:14:22 UTC 2017

## Matthias Fechner (idefix at

> That mailtrain can handle bounce message with postfix together it is
> necessary to tail the postfix log and pass it to mailtrain, using a
> command like this:
> tail -F -n +0 /var/log/maillog | nc localhost 5699 -

That looks like a bad idea. As Eugene already demonstrated, you
can use syslog (not just "our" syslog, all decent syslog daemons
have some way to feed the log into a pipe) - and you can also use
syslog to get the log to the mailtrain host, in case that's not
running on the same host as postfix (or otherwise seperated).
That way, your problem would just not exist, and the setup would
be much more robust in general.
So, if it's possible to hook the mailtrain "receiver" end to
syslog, instead of "some" port...


Spare Space

More information about the freebsd-ports mailing list