Friday, January 11, 2008

Configuring sendmail for Solaris

In Solaris 10, here is how I will set the mail to work:

1) Get the name of SMTP server (suppose it is mail.somecompany.com)

2) Log on to the Solaris 10 server where mail setup is needed.

3) Goto /etc/mail directory

4) Edit file "submit.cf" and add/edit the line containing "DS" in Local info section:
DSmail.somecompany.com

5) Edit file "submit.cf" and add/edit the line containing "Dj" in Local info section:
Dj$w.somecomnapany.com

6) Done! Now send a test mail to verify if it is working.

---------

Once the submit.cf file is edited for adding the SMTP server's entry, try to send a mail from unix command prompt in verbose mode like shown below:

# cat some_test_file_name mailx -v -s "TEST MAIL" unixgeek@somecompany.com
unixgeek@somecompany.com... Connecting to mail.somecompany.com. via relay...
220 a0001-xap0130-s.hodc.ad.somecompany.com Microsoft ESMTP MAIL Service, Version: 6.0.3790.1830 ready at Fri, 11 Jan 2008 09:4 0:13 -0600
>>> EHLO abcnetbackup.somecompany.com
250-a0001-xap0130-s.hodc.ad.somecompany.com Hello [10.40.254.22]
250-TURN
250-SIZE 15728640
250-ETRN
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-8bitmime
250-BINARYMIME
250-CHUNKING
250-VRFY
250 OK
>>> MAIL From: SIZE=1178
250 2.1.0 root@abcnetbackup.somecompany.com....Sender OK
>>> RCPT To:
>>> DATA
250 2.1.5 unixgeek@somecompany.com
354 Start mail input; end with .
>>> .
250 2.6.0 <200801111540.m0bfedrq026161@abcnetbackup.somecompany.com> Queued mail for delivery
unixgeek@somecompany.com... Sent ( <200801111540.m0bfedrq026161@abcnetbackup.somecompany.com> Queued mail for delivery)
Closing connection to mail.somecompany.com.
>>> QUIT
221 2.0.0 a0001-xap0130-s.hodc.ad.somecompany.com Service closing transmission channel


------------------

In the above output, try to look for the bold entries. If you are able to see the "Sent" and "Closing connection for ........" lines, it means that your server is able to talk to mail server of your company.

Happy mailing! :-)

2 comments:

Muthu said...

Hi Vikas, was trying setup sendmail but its not working i have few doubts about sendmail can i ask you about it.

Unix Geek said...

@Muthu: I am no expert on Sendmail as it is a very vast topic. But let me know what is your question. I will try to answer if I know :)