6

CentOS 5.x | SendMail

I'm noticing inconsistent information regarding pushing changes from sendmail.mc

Some documentation suggests that making changes to the sendmail.mc file requires two steps:

  1. Rebuild the cf file: m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
  2. Restart sendmail service

Other documentation suggests that the rebuild process is already done as part of a service restart.

Can I get confirmation on if step 1 is required?


Update: If I grep for make in the init script, the output shows:

[root@foo ~]# grep make /etc/init.d/sendmail
        if test -x /usr/bin/make -a -f /etc/mail/Makefile ; then
          make all -C /etc/mail -s > /dev/null
                makemap hash /etc/mail/$i < /etc/mail/$i
        if [ -x /usr/bin/make -a -f /etc/mail/Makefile ]; then
          make all -C /etc/mail -s > /dev/null
                makemap hash /etc/mail/$i < /etc/mail/$i
pgr
  • 459
  • 5
  • 16
Mike B
  • 11,871
  • 42
  • 107
  • 168
  • 1
    Well...look in the service startup script. You're on CentoS 5, so this will probably be `/etc/rc.d/init.d/sendmail`. Does it rebuild the configuration when you start the service? – larsks Mar 12 '13 at 19:20
  • 1
    It is always to safe to manually make (or m4) the sendmail.mc file into the sendmail.cf file. – mdpc Mar 12 '13 at 20:03

2 Answers2

7

In CentOS you do:

/etc/mail/make
service sendmail restart

You also need to have package sendmail-cf installed. A simple restart does not rebuild the .cf from the .mc.

However (and I am looking at a CentOS 6 machine) the init script calls the routine updateconf upon starting sendmail, so there in 6.x you only restart. What is the out put of

grep make /etc/init.d/sendmail

in your machine?

In Debian sendmailconfig rebuilds the .cf if needed before restarting it.

adamo
  • 6,925
  • 3
  • 30
  • 58
  • Looks like there are make statements in there. Updated info in the question to include this. – Mike B Mar 12 '13 at 19:37
  • So if you change .mc and then type `make all` does it build the .cf? If yes, then it rebuilds on restart. The easiest way to check all this of course is to `touch /etc/mail/sendmail.mc` wait 10 seconds and then `service sendmail restart`. Then `ls -l /etc/mail/sendmail.*` and check the dates. – adamo Mar 12 '13 at 19:37
  • 1
    Yup. The dates match so it would appear that the cf file is automatically updated in my case. Sorry - I guess that was an obvious way to check but I didn't know if the `make` command was adding additional content. – Mike B Mar 12 '13 at 19:53
0

You need to rebuild to generate the new config and restart to apply the configuration.

silviud
  • 2,687
  • 2
  • 18
  • 19
  • In general, I think think that's probably the established/accepted procedure but in my specific case I don't think it's necessary because I can see the make statements in the init script. – Mike B Mar 13 '13 at 14:49