Solved

Sending mail from linux through a relay host

Posted on 2004-08-17
4
273 Views
Last Modified: 2013-12-06
I'm trying to send mail from Fedora Core 2 using "mail" command. The firewall policy does not allow this box to directly send mail out to the internet so I need to make use of the organizations MS Exchange server to relay mails through that box. The exchange server admin has given this box the rights to relay mail but how do I tell linux to send mails out / relay through exchange.

I'm trying to send mail from a shell script which basically notify me about certain tasks it runs.

Any help would be appreciated.

Thanks,
Ajit

0
Comment
Question by:a2k2
  • 2
  • 2
4 Comments
 
LVL 40

Expert Comment

by:jlevie
ID: 11823424
Adding:

define(`SMART_HOST', `nochange.dom.tld')dnl

to /etc/mail/sendmail.mc (replacing nochange.dom.tld withthe FQDN of the exchange server) and restarting sendmail should do the trick. If you need to be able to deliver mail to exchange accounts you'l probably need to also:

define(`LUSER_RELAY', `nochange.dom.tld')dnl

So that mail to some-user@dom.tld that doesn't correspond to an account on the Linux box will be sent to the exchange server.
0
 

Author Comment

by:a2k2
ID: 11823515
Do I HAVE to use sendmail? I'm not running sendmail on this box. Can't I use something similar to 'mail' command? Something small and not complicated as sendmail?

Thanks again
Ajit
0
 
LVL 40

Accepted Solution

by:
jlevie earned 50 total points
ID: 11824335
'mail' is only the client application, what we refer to as a Mail User Agent (MUA). It can be used to read or to submit mail to a Mail Transport Agent (MTA) like Sendmail. Postfix, Qmail, etc. To actually get a message from 'mail' to some other system there must be a properly configured and operating MTA.

The default Sendmail configuration on Fedora prevents it from accepting mail from outside of the local machine, so there's no security or spam risk of it being enabled and active. And a number of things on a Linux/Unix system depend on a mail system being active on the system because they use mail for system notices (to root generally) and reports. So it's not a good idea to disable the mail system and one should check root's mail or forward it to an account you do check via the aliases map.
0
 

Author Comment

by:a2k2
ID: 11825790
Thank you jlevie. I'm now able to send mails through relay server.

Regards,
Ajit
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now