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

I have a sendmail problem, and I'm anything but a sendmail guru -- I could use some help.

My problem is that I have a system intended to be more or less an "appliance" -- it's not intended to have an admin. Because of this, it needs to be able to "call home" by sending email. As we have configured it, this works fine -- using sendmail, it finds the appropriate relay by looking up an MX record and everything works fine.

Now, however, because of security concerns, we want to limit it to using exactly one relay, so for example Should the user configure it to use, say,, the mail sending should fail or be deferred.

I thought that by configuring sendmail with a /etc/mail/server.switch file containing

hosts   files

without dns, I'd get that effect. This doesn't work -- instead, if it gets mail addressed to, it tries to talk directly to, and ignores the configured server.

Any ideas?


Okay, I tied both schemes experimentally, and they both seem to work. Wish I could mark them both correct.

share|improve this question
up vote 6 down vote accepted

Are you using m4 to build your If so, you should add


to your and regenerate your It looks like adding

right to the will do the trick too.

share|improve this answer
He shoots, he scores. Thanks. Now to make the %^#$@#^$% application rewrite its – Charlie Martin Feb 4 '11 at 23:27

Here is an M4 file for a SuSE system for simply forwarding ALL email to the relay host.
(Its included in the SuSE distribution as well). You simply do m4 > where is the file below and would be the file to replace your file (usually in either /etc/ or /etc/mail/

 # Copyright (c) 1999 SuSE GmbH Nuernberg, Germany.
 # Copyright (c) 2006 SuSE LINUX Products GmbH, Germany.
 # Author: Werner Fink
 # Please send feedback to
 # This is a special case -- it creates a stripped down configuration
 # file containing nothing but support for forwarding all mail to a
 # central hub via a local SMTP-based network.  The argument is the
 # name of that hub.

 VERSIONID(`@(#)Setup for SuSE Linux     0.2 (SuSE Linux) 2002/01/14')
 dnl  This is the default configuration for SuSE Linux.
 dnl  See /usr/share/sendmail/ostype/suse-linux.m4
 dnl  and /usr/share/sendmail/README for more information.
 dnl  A stripped down configuration. Replace the mailhub.domain.notused
 dnl  with your real mailhub.
 FEATURE(`nullclient', `')dnl
 dnl  This line is required for formating the /etc/
share|improve this answer
Thanks, I'd just now read about the nullclient feature and was wondering how to configure it. – Charlie Martin Feb 4 '11 at 23:39

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.