Saturday, May 30, 2015

What is the difference between "dnl" and "dnl #" in a sendmail.mc file?



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

Answer



There's a subtle but important difference between dnl and # here.



dnl means "delete through newline". When you process your sendmail.mc into a sendmail.cf using m4 (or possibly some frontend), the characters dnl and everything following them, including the next newline, will be dropped. (And all of those lines end with dnl to suppress extra blank lines in the sendmail.cf output.)



Nothing beginning with dnl through end of line will make it out of sendmail.mc and into sendmail.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 into sendmail.cf, where they will be ignored.



Anything beginning with # and not deleted above will make it into sendmail.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.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...