Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 only want sendmail to relay through my ISP's smtp server, nothing else. How do i set it up?

share|improve this question
up vote 11 down vote accepted

You have specified answer in the question itself. You can do that using

define(`SMART_HOST', `smtp.your.provider')dnl

Are you facing any problem using this. After editing /etc/mail/ you should go to directory /etc/mail. Type make and then restart sendmail service for changes to take effect. Then send a test mail and see message headers (Received:) to see if configuration worked.

share|improve this answer
Make command will call m4 to parse again and it will also build other databases like aliases if we have changed them. – Saurabh Barjatiya Jul 16 '09 at 8:26

If you aren't doing anything more fancy with the cumbersome beast that is Sendmail then you could consider using SSMTP instead.

It's a relay-only MTA which is lightweight and couldn't be simpler to configure.

share|improve this answer
ah, thanks, hadn't done my research very well.. SSMTP was much easier! – Carl Hörberg Jul 19 '09 at 17:36

Do yourself a huge favour and replace sendmail with either a modern mta like postfix or something more lightweight like ssmtp. I'm amzed that sendmail is still used voluntarily

share|improve this answer
done! thanks :) – Carl Hörberg Jul 19 '09 at 17:37

Nullmailer, IMHO, is even easier to configure. Here is a quick howto:

apt-get install -y nullmailer

Edit this file:

nano /etc/mailname
  • Enter your domain name, like
  • Save

Edit another file:

nano /etc/nullmailer/remotes
  • Enter your smtp server data: [] smtp --auth-login --user=[username] --pass=[password]
  • Save


share|improve this answer

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.