Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

how to check whether sendmail option is configured for smtp relay in solaris server

share|improve this question

migrated from Nov 4 '09 at 11:56

This question came from our site for professional and enthusiast programmers.

Grep for "DS" in either /etc/mail/ or /etc/mail/ That is generally where it is configured.

share|improve this answer

I'm thinking what you want to know is, "How can I tell if sendmail is configured to act as a relay", if that isn't correct, I apologize. SMTP is redundant there, because it's a relay.

Check the version of sendmail you're using. If you're using 8.9.3 or older, you're probably relaying by default. If you're running a newer version, you're probably not.

Sendmail configuration is complex, but configuring sendmail as a relay is probably one of the most common tasks. I'd tell you to look at the /etc/mail/ file, which is the "readable" file, but people have a tendency to copy the byzantine raw file ( from machine to machine, so you can't be certain the cf and the mc file are the same. If you're brave you can wade through the file and look for domains prefaced with the DR,DH,CM, or DM macro flags (usually present when relaying is enabled)...Yea, that sucks. The easier way is to look around outside the file.

First check the check the /etc/mail/access and the /etc/mail/relay-domains files to see if they've been fiddled with. If there are actually non-local entries in those files, its likely someone set up some kind of relay. If they're empty, it's likely that there isn't a relay (if there is one its an open relay, which would be scary). Lot of times localhost and such will be set up in there. That's just so you can send local mail.

The easiest way to test for an open relay is to just try to send a message.

Create a test file test_file for remote delivery with the following content:

Subject: TEST MAIL.

This is a Header Test
(empty line)

Save that, then type the following:

cat test_email | /usr/lib/sendmail -bm -t -v

Lot of sites reject mail if they can't do a reverse lookup on the host, so you may have to try several if your host doesn't resolve.

If you still can't tell, you're going to have to learn to wade through the cf file (or show it to someone who can read it). Hope this is at least somewhat helpful.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.