Solved

sendmail not working

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

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Linux FTP Error 5 45
IP 10.0.1.2 / 255.0.0.0 61 78
CentOs root password/fsck issue 7 33
Krita v3 Linux Mint/Ubuntu 16.04 9 16
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

756 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