Solved

sendmail not working

Posted on 2011-09-28
4
498 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
  • 2
4 Comments
 
LVL 77

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 77

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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
Fine Tune your automatic Updates for Ubuntu / Debian
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…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

803 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