Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question

migrated from stackoverflow.com Nov 4 '09 at 11:56

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

2 Answers 2

Grep for "DS" in either /etc/mail/sendmail.cf or /etc/mail/submit.cf. 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/sendmail.mc file, which is the "readable" file, but people have a tendency to copy the byzantine raw file (sendmail.cf) 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 sendmail.cf 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 sendmail.cf 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:

To: testuser@testdomain.com
From: root@your_box.com
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

 
discard

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