Solved

Sending mail from linux through a relay host

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Virtual Box issue 6 82
bash script question (chmod) 10 53
linux installs 6 47
Which is more secure: EAP or machine certificate for IKEv2 VPN? 1 34
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
SSH (Secure Shell) - Tips and Tricks As you all know SSH(Secure Shell) is a network protocol, which we use to access/transfer files securely between two networked devices. SSH was actually designed as a replacement for insecure protocols that sen…
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.

914 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

13 Experts available now in Live!

Get 1:1 Help Now