What is the difference between dnl
and dnl #
in a /etc/mail/sendmail.mc
file? If I want to enable something what needs to be in front? Likewise, if I want to "comment out" something, what prefix do I need?
For example:
dnl # masquerade not just @mydomainalias.com, but @*.mydomainalias.com as well
dnl #
dnl FEATURE(masquerade_entire_domain)dnl
dnl #
dnl MASQUERADE_DOMAIN(localhost)dnl
dnl MASQUERADE_DOMAIN(localhost.localdomain)dnl
dnl MASQUERADE_DOMAIN(foo.com)dnl
dnl MASQUERADE_DOMAIN(foo2.lan)dnl
MAILER(smtp)dnl
MAILER(procmail)dnl
dnl MAILER(cyrusv2)dnl
There's a subtle but important difference between
dnl
and#
here.dnl
means "delete through newline". When you process yoursendmail.mc
into asendmail.cf
usingm4
(or possibly some frontend), the charactersdnl
and everything following them, including the next newline, will be dropped. (And all of those lines end withdnl
to suppress extra blank lines in thesendmail.cf
output.)Nothing beginning with
dnl
through end of line will make it out ofsendmail.mc
and intosendmail.cf
.Anything that remains in the output, of course, will either be sendmail configuration, or a comment that begins with
#
, which will be copied as-is intosendmail.cf
, where they will be ignored.Anything beginning with
#
and not deleted above will make it intosendmail.cf
unmolested as a comment.In your example, someone meant for all of the commented features to be removed from
sendmail.cf
, as well as the comments, since the comments would be meaningless without the features present.DNL means "delete through newline" which really means "ignore everything after 'dnl' until the next line".
The "dnl #" is just artificial nomenclature. When the sendmail.mc file was first developed they wanted you to know that anything that was "dnl ..." was a command/setting that was commented out and anything that was "dnl #..." was really a descriptive comment that was not a command/setting that could be uncommented because '#' is often used at the beginning of a line to indicate "what follows until end of line" is a comment.
Yes, 8 years old, and no-one's ever going to read this, but I just wanted to point out that putting two
dnl
s on a line is completely pointless. It doesn't "suppress extra blank lines in thesendmail.cf
output", as suggested above.Since a picture is worth a thousand words:
Produces this output: