How to setup Relay host in sendmail?

  • hotrinhvuong
  • Born
  • Born
  • hotrinhvuong
  • Posts: 1

Post 3+ Months Ago

Hi,

My company has a need to relay all outgoing messages on our mail
server (sendmail) to a relay mail server for forwarding to the Internet.

Anyone knows how to configure sendmail mail server to do just
that ?

Thanks,
Vuong Ho.
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • this213
  • Guru
  • Guru
  • User avatar
  • Posts: 1260
  • Loc: ./

Post 3+ Months Ago

You just need to set up relaying on the relay server and make your local server use that as a gateway. My question is - why bother? It seems like an unnecessary hop. If it's because you're behind a firewall, you're going to tie up that firewall just as much having it flat out send as you will having it forward to another server to send for you.

At any rate, you want the relay-domains file on the relay server. Enter the domains to route for, 1 per line. The location of this files varies, but look in /etc/mail/ or /etc/sendmail/ or some such.

Also, if you're at the stage where you have to come up with complex routing scemes for sendmail and nobody there knows how to configure sendmail properly, you might want to do yourself a favor and get webmin ( http://www.webmin ) installed on the mail server. It's free.

hth
This
  • Daemonguy
  • Moderator
  • Web Master
  • User avatar
  • Posts: 2700
  • Loc: Somewhere outside the box in Sarasota, FL.

Post 3+ Months Ago

/etc/mail/relay-domains contains a list of hosts which are allowed to relay mail through your mail server. This list may consist of either specific hosts or whole domains.

/etc/mail/sendmail.cw (after sendmail version 8.10, this file is local-host-names) contains a list of domains for which your mail server will accept mail. This list is usually the domains hosted by your machine.

NOTE: put a CR/LF at the end of the last domain. Otherwise it won't work.


Of course you have to set up your actual sendmail server to use the mail relay.
If your unix host has to use a mail relay to get out, the simplest, usually enough, method is to define the DS (smart relay) macro in sendmail.cf. You should have a line with
DS
change it in
DSmailrelay.domain
where mailrelay.domain is the FQDN of your mail relay as seen from your side.
The stop/start sendmail to let it reread the config file.

This mail relay must accept SMTP connection from your host and must accept relaying. To check if the mail relay is working try

telnet mailrelay.domain 25
.... answer from mail relay .....
helo <unix hostname>
mail from: root@<unix hostname>
rcpt to: <email test>@<something out>
data
mail test from unix
.

mail server should answer something like mail sent. If this work you can try with a normal mail client like

mailx -s "subject" <email test>@<something out>
mail test from unix
.

To check if this has work look at /var/adm/syslog/mail.log
you should see a couple of lines stating the mail has been accepted locally and sent to the relay and accepted.

Good luck.
  • datums
  • Novice
  • Novice
  • datums
  • Posts: 28

Post 3+ Months Ago

I have seen this used before for spam and virus scanning.
Were an outsourced company received outbound/inbound(mx) mail for the company. So every inbound mail is scanned for virus and spam.

I know in Exchange you would use a smarthost.
  • scr3am
  • Newbie
  • Newbie
  • scr3am
  • Posts: 8
  • Loc: Netherlands

Post 3+ Months Ago

vi /etc/mail/sendmail.cf

search for DS

# "Smart" relay host (may be null)
DS<ip-address to relay>

restart sendmail.
  • whathappen
  • Born
  • Born
  • whathappen
  • Posts: 1

Post 3+ Months Ago

you can edit /etc/mail/sendmail.cf or /etc/sendmail.cf depend on your operating system.

and edit as

# “Smart” relay host (may be null)
DS<mailserver_hostname>

exam.
DSmailserv.whathappen.com

PS.

if you used dns name, or hostname ,please make sure that your server can lookup ip from hostname.

referrence :

http://blogitknowledge.u-indy.com/syste ... l-quickly/

Post Information

  • Total Posts in this topic: 6 posts
  • Users browsing this forum: No registered users and 58 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.