Solved

sendmail not working

Posted on 2011-09-28
4
520 Views
Last Modified: 2012-05-12
Hello Experts,

I am trying to execute the following command:

(echo "Subject: test" ; echo "test" ; ) | /usr/sbin/sendmail <my email address>

However, I do not receive any email.
I have tried to add the -v flag.
However, I don't receive any verbose.

The sendmail queue is empty.

How can I start to resolve this?

Thanks!
0
Comment
Question by:jagku
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 79

Expert Comment

by:arnold
ID: 36716398
This is not a properly formatted message

check /var/log/maillog to see what happened to what you tried to do.


echo "To: <recipient>
From: <sender>
Subject: test

test

"| /usr/sbin/sendmail <recipient>
0
 
LVL 14

Expert Comment

by:sjm_ee
ID: 36716455
If you are writing a script to send an email I wouild use the "mail" or "mailx" or "mutt" commands instead of "sendmail". For example:

( echo "test" ; ) | /usr/sbin/mail -s "Subject: test" <my email address>
0
 

Author Comment

by:jagku
ID: 36716577
arnold:

Thank you. I get the following in the log (have replaced my email address with name@example.com):

ep 28 13:51:14 my-dev sm-mta[28420]: p8S94mTV025475: to=<name@example.com>, ctladdr=<www-data@localhost6.localdomain6> (33/33), delay=03:46:26, xdelay=00:00:00, mailer=esmtp, pri=1740433, relay=mx183.emailfiltering.com., dsn=4.0.0, stat=Deferred: Connection timed out with mx183.emailfiltering.com.

What does this mean?

sjm_ee - thanks. I want to use php to send email. However, it doesn't appear to be working as I can't get sendmail to work.
0
 
LVL 79

Accepted Solution

by:
arnold earned 500 total points
ID: 36717030
It means that the mx183.emailfiltering.com was not accepting a connection from your system.
This is either because the system was unavailable at the time.
The remote system has a configuration that your system does not match so it does not let it connect. Forward/reverse resolution issue.
Check your external IP http://whatismyip.com
then lookup the IP (nslookup <IP> and then if it returns a name, do nslookup <name> you can use dig instead of nslookup)

try running the following command from the shell:
telnet mx183.emailfiltering.com 25 to see whether you can establish a connection.
Your outgoing SMTP traffic might be blocked by your ISP.

If your ISP provides with an SMTP mail server, you should configure sendmail to relay through it.
http://www.cyberciti.biz/faq/configure-sendmail-as-a-smart-host/
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
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.:
Suggested Courses

628 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