Page 1 of 1

Sendmail service in Solaris 10

Posted: Mon Feb 06, 2012 8:00 pm
by cah
Last Friday (02/03/2012), I compiled sendmail 8.12.5 and the global zone works fine while non-global zones had issues initially.

Then, I created empty access file in /etc/mail and created dbm files that started one NGZ but the other still behaved strangely. I didn't have much time last Friday to really look into the root cause so I picked up again today.

The problematic NGZ does not log anything in /var/log/syslog. It was working before until 11/02/2011 (according to the timestamp on the log file). I restarted sysglogd several times last Friday and that didn't make any difference. I knew it is not syslogd's issue then. All logs are getting entries except for this specific NGZ. That led me to the sendmail issue.

Sendmail on this NGZ (badmingtonequipments.com) can send email but could not accept incoming traffic.
"/usr/lib/sendmail -Ac -q15m" was at presence but "/usr/lib/sendmail -bd -q15m" was missing.

I went to /var/adm/messages and found it was complaining about a syntax in local.cf:

Code: Select all

Feb  6 10:15:52 badmintonequipments sendmail[23073]: [ID 801593 mail.crit] NOQUE
UE: SYSERR(root): /etc/mail/local.cf: line 61: invalid V line vendor code: "Sun"
I did a comparison with sendmail.cf and found sendmail.cf has

Code: Select all

V10/Berkeley
while local.cf has:

Code: Select all

V10/Sun
Since the local.cf was from 8.13.8 (long time ago), I couldn't tell any more so I just copied sendmail.cf into a new local.cf and it started up fine. The only difference this NGZ has is it has an extra option after "/usr/lib/sendmail -bd -q15m":

Code: Select all

/usr/lib/sendmail -bd -q15m -C /etc/mail/local.cf
This makes me very curious. Why does sendmail require a local.cf to start? I renamed local.cf to a temp name and tried restarting it. For sure, it did not come up and /var/adm/messages has the following error:

Code: Select all

Feb  6 11:10:22 badmintonequipments sendmail[23524]: [ID 801593 mail.crit] NOQUEUE: SYSERR(root): /etc/mail/local.cf: line 0: cannot open: No such file or directory
That means it is looking for local.cf to start sendmail daemon.
Strange thing is, none of the configuration files has this specified in them. I know Solaris 10's svc has some config/methods that might provide me some clues so I went to /lib/svc/method/smtp-sendmail and check how it handles the startup process. Here is the only local.cf I found:

Code: Select all

        local=`/usr/bin/svcprop -p config/local_only $SMF_FMRI 2>/dev/null`
        if [ $? = 0 -a "$local" = "true" ]; then
                OPTIONS="$OPTIONS -C /etc/mail/local.cf"
        fi
This file is identical with global zone and another NGZ. That means the service property of sendmail must be different. I then ran the following command on all zones and results are different:

Code: Select all

/usr/bin/svcprop -p config/local_only svc:/network/smtp:sendmail ; echo $?
false
0
badmintonequipments.com

Code: Select all

/usr/bin/svcprop -p config/local_only svc:/network/smtp:sendmail ; >
true
0
Another command shows the difference as well:

Code: Select all

% svcprop sendmail | m
config/local_only boolean false
badmintonequipments.com

Code: Select all

% svcprop sendmail | m
config/local_only boolean true
Why are they showing differently? I totally have no clue. All NGZs are cloned from a template and should have identical config. I don't know why.

In sendmail's man page, the section of "Enabling Access to Remote Clients", it addresses:
Enabling Access to Remote Clients
On an unmodified system, access to sendmail by remote
clients is enabled and disabled through the service manage-
ment facility (see smf(5)). In particular, remote access is
determined by the value of the local_only SMF property:

svc:/network/smtp:sendmail/config/local_only = true

A setting of true, as above, disallows remote access; false
allows remote access. The default value is true.

The following example shows the sequence of SMF commands
used to enable sendmail to allow access to remote systems:

# svccfg -s svc:/network/smtp:sendmail setprop config/local_only = false
# svcadm refresh svc:/network/smtp:sendmail

See svcadm(1M) and svccfg(1M).

Note, however, on a system where any of the sendmail(4)
files have been customized, setting this property might not
have the intended effect. See sendmail(4) for details.
It looks like I can manually turn it off by the above command and restart it.

After I ran the two commands, I had to restart sendmail to get rid of the -C /etc/mail/local.cf.

At least, they are consistent now but it still does not resolve syslog issue. It is still not logging mail activities.....

Sendmail property

Posted: Mon Feb 06, 2012 8:15 pm
by cah
The only command I ever ran today was netservices.
Out of curiosity, I ran it again to see what happens:

Code: Select all

/%netservices limited
restarting syslogd
restarting sendmail
restarting wbem
dtlogin needs to be restarted. Restart now? [Y] y
As expected, the sendmail's local_only property got changed from false to true again!

Code: Select all

/%/usr/bin/svcprop -p config/local_only svc:/network/smtp:sendmail ; echo $?
true
0
Another manual setting for the service property needs to be re-done and restarting of sendmail is needed as well.

That means I changed the property without knowing it after I ran "netservices limited" command.
This is an interesting finding for sure.
However, it still does not address why syslog is not logging anything into /var/log/syslog (mail.debug).....

property can NOT be reset

Posted: Mon Feb 20, 2012 5:48 pm
by cah
I installed a new server - cahtoh at home.

I configured it to be SMTP AUTH capable.
The OS is Solaris 10 update 10 (8/11).
Sendmail did not come with smtp-sendmail method. It came with sendmail-client in /lib/svc/method only.
I had to copy the method file from hsiao.net to cahtoh.

When I tried to start it, it was complaining about local.cf and I know the local_only config must be set true.

Code: Select all

/usr/bin/svcprop -p config/local_only svc:/network/smtp:sendmail ; echo $?
true
0
I tried to set it to false so that sendmail doesn't have to pick up local.cf.

Code: Select all

svccfg -s svc:/network/smtp:sendmail setprop config/local_only=false
It ran without errors. However, when I checked the property value again, it is still showing true.

I don't have time to troubleshoot and just copy sendmail.cf to local.cf and start sendmail.

04/01/2012

While working on Solaris 11, I encountered the same issue.

Code: Select all

%/usr/bin/svcprop -p config/local_only smtp
true
%svccfg -s svc:/network/smtp:sendmail setprop config/local_only=false
%/usr/bin/svcprop -p config/local_only smtp
true
Still showing true.

I then went into svccfg to check.

Code: Select all

%svccfg -s svc:/network/smtp:sendmail
svc:/network/smtp:sendmail> editprop
select svc:/network/smtp:sendmail

# Property group "config"
# delprop config
# addpg config application
# setprop config/include_info = boolean: false
# setprop config/path_to_sendmail_mc = astring:
# setprop config/value_authorization = astring: solaris.smf.value.sendmail
# setprop config/local_only = boolean: false
......
It had been set.
I then realized that I need to run svcadm refresh to read the new settings.

Code: Select all

%svcadm refresh network/smtp:sendmail
%/usr/bin/svcprop -p config/local_only smtp:sendmail
false
It finally changed to false and sendmail can be started/stopped properly from /etc/init.d/sendmail.