Viktor Dukhovni: > On Sun, Oct 12, 2014 at 09:20:41PM +0200, A. Schulze wrote: > > > >How would Postfix know that "relay" ends at line 2? Comments may > > >appear IN THE MIDDLE of a master.cf entry. > > > > Technically correct. > > I read "line 3" but should read "the entry starting somewhere and end in > > line 3" > > It is perhaps sufficient to report the line number of the entry > start. Try the patch below:
Unfortunately, that lists the first master.cf entry as something that starts at line 1. I have a version that reports the first and last non-empty, non-comment line numbers of a master.cf entry, or just one line number if the two are the same: Oct 13 13:11:28 tail postfix/master[13132]: /etc/postfix/master.cf: line 71: using backwards-compatible default setting chroot=y Oct 13 13:11:28 tail postfix/master[13132]: /etc/postfix/master.cf: line 98-99: using backwards-compatible default setting chroot=y /etc/postfix/master.cf: ... 70 # ================================================================= 71 smtp inet n - - - - smtpd 72 # -o receive_override_options=no_header_body_checks ... 98 :628 inet n - - - - qmqpd 99 -o qmqpd_authorized_clients=127.0.0.1 100 # -o content_filter=scan:[127.0.0.1]:27 ... But I'll drop the "last" line number because it is unnecessary given that we now have a precise start line number (instead of the start of the comment before the master.cf entry). Wietse