Link to home
Start Free TrialLog in
Avatar of a2k2
a2k2

asked on

Sending mail from linux through a relay host

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

Avatar of jlevie
jlevie

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.
Avatar of a2k2

ASKER

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
ASKER CERTIFIED SOLUTION
Avatar of jlevie
jlevie

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of a2k2

ASKER

Thank you jlevie. I'm now able to send mails through relay server.

Regards,
Ajit