Solved

sendmail not working

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

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 76

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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Backup folder managed by open source CMS 2 55
Parse DNS log 3 33
Anti-virus for Linux Server 15 85
Sendmail STARTTLS error 37 40
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

707 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now