Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

So, I'd like to send email from my server.

I installed mailx

apt-get install mailx

But a command like

mail -s "Hello world" me@gmail.com

Is actually giving an error in /var/spool/mail/ which says:

Mailing to remote domains not supported.

Why is that happening?

share|improve this question

3 Answers 3

up vote 3 down vote accepted

What MTA are you using locally? mail just gives you the ability to form a mail message, but you still need and MTA to do the actual delivery? By default, most distributions come with sendmail by default. You'll likely need to install another MTA or configure the current one to support outside delivery.

share|improve this answer
    
From the logfile here, it looks like exim 4.69 –  bobobobo Aug 20 '10 at 17:34
    
If you're running Debian/Ubuntu, you'll need to edit /etc/exim4/update-exim4.conf.conf and change the line to read dc_eximconfig_configtype='internet' and restart exim. If you're using another distro, make sure this line looks like this hostlist relay_from_hosts = 127.0.0.1 –  vmfarms Aug 20 '10 at 17:43
1  
Actually I used the dpkg-reconfigure exim4-config "wizard" command and it works now! Thanks! –  bobobobo Aug 20 '10 at 17:47

Because mailx expects a full SMTP infrastructure, which is not configured by default. What kind of SMTP server, if any, do you have installed (i.e. postfix, exim, sendmail, qmail)?

share|improve this answer
    
I believe I have exim –  bobobobo Aug 20 '10 at 17:34

If you don't have an internal SMTP server installed you could send your mail for example through a gmail SMTP server, you can install sSMTP MTA and configure it with gMail SMTP Server, or another external SMTP server.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.