Configuring sendmail on Solaris 10 for outgoing mails ==Configurations== This document couldn't possibly cover everything there is to know about Sendmail without being hundreds of pages long, and a bore to read. Instead, we focus on three commonly seen configurations: Mail Server, Incoming Relay, and Outgoing Only. When modifying the behavior of Sendmail, the /etc/mail/sendmail.cf file is not directly altered. Instead, a .mc file is altered and run through the m4 macro processor. Some example .mc files are in /usr/lib/mail/cf: * main.mc is the default setup system. * submit.mc configures Sendmail as an initial mail submission program. * subsidiary.mc relays all mail on this system through another machine before the mail goes to its destination. For our examples, we will copy the main.mc file to new.mc and make our modifications like so: cd /usr/lib/mail/cf vi new.mc make new.cf cp new.cf /etc/mail/sendmail.cf /etc/init.d/sendmail restart ==Outgoing Only== For security purposes, it's best not to set up an indiscriminate mail relay. Every machine needs to use an MTA to send email, and some programs require the ability to relay emails through an SMTP server. With these requirements, you can both relay mail for local services and secure your system from becoming an open relay by configuring Sendmail to attach only to the loop-back address. To make Sendmail outgoing only, it needs to not accept mail from any remote hosts. To do this, we force it to use only the local loop-back address. No other options are required; Sendmail transports mail from the local machine to the outside world by default. End result: OSTYPE(`solaris8')dnl DOMAIN(`solaris-generic')dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA') MAILER(`local')dnl MAILER(`smtp')dnl Note: Do not forget to change /etc/nsswitch.conf by adding... hosts: files dns ==Testing== 4. Testing by sending email to local and external user mailx -s testlocal localuser mailx -s testexternal someuser@somedomain.com Resources: http://www.sun.com/bigadmin/features/articles/config_sendmail.jsp