Solved

Sending mail from linux through a relay host

Posted on 2004-08-17
4
280 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to show how we can create Linux Mint virtual machine using Oracle Virtual Box. To install Linux Mint we have to download the ISO file from its website i.e. http://www.linuxmint.com. Once you open the link you will see …
Fine Tune your automatic Updates for Ubuntu / Debian
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

691 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