Solved

sendmail not working

Posted on 2011-09-28
4
517 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 78

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 78

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
spectrum scale snapshot  resotre/mount 1 58
database connection error mysql stops 7 82
How to fix Dual Server Conflict GitLab vs Apache2 3 58
sed command 3 29
Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

739 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