Friday, July 05, 2013

Send mail through smarthost in Solaris

$ /opt/csw/bin/gsed -i 's/^DS[\s]*.*/DS smarthost.sample.com/g' /etc/mail/submit.cf
$ svcadm restart sendmail #/etc/init.d/sendmail restart is deprecated (Thanks Douglas Perry!)
$ echo "My Body" | mailx  -s "`hostname` My subject" myMail@sample.com

1 comment:

Unknown said...

I was a Sun Technical Support Engineer during the transition to Solaris 9 to 10. I must worked dozens of support cases from cu's (customers) asking why Sun eliminated the init.d scripts and how to restart a service using svcadm. Once you dig into Service Management Facility, you'll start to appreciate the advancements.

svcs -a returns a list of services

svcadm manages them.

Followers