Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 06-15-2011, 02:12 PM   #1
Registered: Nov 2003
Posts: 788

Rep: Reputation: 39
Configuring sendmail to relay messages to a e-mail gateway

Hi there --

We have a sendmail server located in a DMZ that has normally been able to send SMTP traffic to whatever destination is listed in the address of any given e-mail message.

A recent change in network configuration has introduced an e-mail gateway that all servers need to send smtp traffic to in order for the messages to go out to the Internet. I am not familiar with how to configure sendmail to relay traffic to the gateway, and I was hoping someone could lend a hand here.

Old 06-15-2011, 03:17 PM   #2
LQ Guru
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 6,953
Blog Entries: 14

Rep: Reputation: 1166Reputation: 1166Reputation: 1166Reputation: 1166Reputation: 1166Reputation: 1166Reputation: 1166Reputation: 1166Reputation: 1166
Is the "gateway" actually a "relay" server?

If so you just need to set that as your relay host.

In /etc/mail/ find the line that has SMARTHOST in it.
For example:
dnl define(`SMART_HOST', `localhost')dnl

Remove the leading dnl (this says "do not load" and is the equivalent of a #/comment in shell script files).
Put the name of the gateway server there instead of what might be there (e.g. replace localhost in my example).
Run make -C /etc/mail to update your sendmail files (assuming this is in /etc/mail). This updates all files from the source files. Note that for RHEL/CentOS you have to have both the sendmail and packages installed for this to work. Not sure about other distros.

The make will created a new from the and in the cf file you'll see a line that starts with "DS" and is followed by the relay host you specified above.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Sendmail: Relay Messages to Ext. SMTP Server? JmaJeremy Linux - Server 2 02-10-2010 11:59 AM
Setting Up Mail Relay - Sendmail or Other? weisdaclick Linux - Software 2 09-01-2009 02:39 PM
Using sendmail to relay mail to ISP mail server Swift&Smart Linux - Software 26 11-09-2008 03:00 PM
Sendmail as a relay gateway Beamzz Linux - Server 1 04-22-2008 03:06 AM
relay mail to sendmail relay server??? lemay_jeff Linux - Newbie 0 07-06-2004 04:54 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:23 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration