Solved

Sending mail from linux through a relay host

Posted on 2004-08-17
4
277 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

770 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