Ubuntu - Mailx config

OS: Ubuntu 6.06

I need to change the SMTP server name/ip that mailx uses to send email through?

Instead of sending mail via our ISP I want to change it to go through our exchange server. If its local, it then doesn't have to leave the building.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I suppose someone told mailx what SMTP server to use during initial setup. This must be possible to edit. At what point do you experience a problem?
There are a few ways to point mailx to an smtp server.  So, it really depends on "how" it was done.  For a start, I would recommend you to try to check:

$ echo $smtp
$ cat ~/.mailrc

and see if you can get a clue there.
virtualworksAuthor Commented:
I didn't set the machine up - I have inherited it. I also have no idea how it was done.

the echo $smtp command returned a blank line.

the cat `/.mailrc returned a new line with a >

I was logged in as root when I ran the commands.

Any ideas?
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Could you check if you have /etc/mail/mailx.rc or /etc/mail/Mail.rc and if you have them what are their content?
virtualworksAuthor Commented:
I have /etc

but I do not have /etc/mail folder
Try locating the files then:

# locate mailx.rc
# locate Mail.rc
virtualworksAuthor Commented:
location was /etc/mail.rc

contents are as follows:

set ask askcc append dot save crt
ignore Received Message-Id Resent-Message-Id Status Mail-From Return-Path Via Delivered-To
Ubuntu uses Postfix as the default MTA.  Could you check /etc/postfix/main.cf if there is a relayhost entry in it?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
virtualworksAuthor Commented:
And that's exactly where the old setting was!


It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.