Need Help getting Sendmail to ACCEPT mail on CentOS 6

Posted on 2014-04-17
Last Modified: 2016-02-11
Greetings All,

it has been awhile since I have been on EE but I now find that I need help.

First let me give a brief history of what I am wanting to do and them I'll get into the Sendmail Issue.

History: I am currently in the mode of moving a bunch of Domains, Emails and MySQL data from an existing FreeBSD machine to a Virtual CentOS machine. The FreeBSD box is hosted by 1800Hosting and the Virtual CentOS "box" is hosted by Wild West Domains (now owned by GoDaddy).

I have CPanel installed on the CentOS machine but quite frankly I am more of a Command Line interface person and I have not been successful in getting mail to work through CPanel.

So .. I installed Sendmail via the CLI and set up the Virtual machine as a DNS Server. I have the DNS server portion working but so far I have not been able to get Sendmail to start Accepting email.

On my FreeBSD box I get the following process information back when I check to see if sendmail is running:
$ ps -auwx | grep sendmail
root    888  0.0  0.0  3776  1508  ??  Ss   20Mar13  16:08.10 sendmail: accepting connections (sendmail)
smmsp   894  0.0  0.0  3384   772  ??  Is   20Mar13   0:06.34 sendmail: Queue runner@00:30:00 for /var/spool/clientmqueue (sendmail
root  16335  0.0  0.1  3776  2112  ??  S    12:32PM   0:00.00 sendmail: startup with (sendmail)
rrb   16337  0.0  0.0  1592   904  p1  S+   12:32PM   0:00.00 grep sendmail


However on the CentOS machine the following is the only thing I get back:
root@ip-50-62-8-115 [/etc]# ps -ef | grep sendmail
mailnull  7741     1  0 09:55 ?        00:00:00 /usr/sbin/sendmail -L sm-msp-queue -Ac -q1h
root     10172  5551  0 11:29 pts/0    00:00:00 grep sendmail

So.. I have tried the You-Tube and Google route to find a solution but so far I have not been successful. I am sure that there is something that I am overlooking and I may just need an extra pair of eyes to help me through this...

Any help you can offer will be greatly appreciated.

Question by:rrbecker
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
  • 8
  • 6
  • 2
LVL 78

Expert Comment

ID: 40008098
I realize your question, any way to persuade you to switch to postfix instead?
There are different configuration files.

Are you using system users as the mailboxes,or are you planing on virtual users/mailboxes.

Within master.conf there are references to a virtual domain table as well as virtual user tables that need to be setup.

If you have cpanel, you should use it because in the event you or someone else makes a change init, it could adversely affect all your prior setups.

Cpanel,  guide to Add a virtual domain

Author Comment

ID: 40008125
Hi Arnold...

Thanks for the reply...

Well I am a FreeBSD person from WAY back and I have always used Sendmail. However, since my goal is to provide email to all my previous FreeBSD users via POP3, I guess if PostFix is easier to get going then I am not opposed to switching.. This is a new server and it is not 100% necessary that I maintain Sendmail.

I assume that you would help walk me through the removal of Sendmail and the Installation of Postfix.. Right??

LVL 78

Expert Comment

ID: 40008140
The steps are straight forward
yum erase sendmail
yum install postfix

Before that, if you cpanel, it maintains and updates.

Question whether you are intent on managing any email functionality through editing individual configuration files versus using a database such mysql as the backend for your mail handling.

For postfix, you would need additional packages to allow for pop3, imap access to the data.

If your cpanel+sendmail setup is driven by mysql! then instead of command line editing of configuration files! you would need to access mysql, and update tables by adding a domain to one table! while then adding users to another table! and then creating the respective folder ......

Presumably because you have cpanel, its purpose is to allow your subscribers to manage their domains, users.
There are perils in trying to manage/configure a system when there are two separate methods in use.  One could overwrite implementations made by another.
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

LVL 78

Expert Comment

ID: 40008146
You've likely looked at it:

IMHO, some of your users/clue that one point or another will reach out with a difficulty dealing with them having an issue that they need help with using cpanel.

Also using the cpanel, it might make it clear where the configuration files or how the data is managed if it is entirely/mixture flat files and database.

Author Comment

ID: 40008194
Hi Arnold....

Cpanel was installed as part of the initial offering when I purchased the Virtual Server. CPanel is not actually required because this server will not have any Actual Users on it.. ie No Web accounts.

The only users will be in the form of email users and these users will access their email via POP3..

Actually I would prefer that CPanel was not even there. I Prefer to handle the configuration myself via the command line interface...

Can you still help me even if I do not use Cpanel??

LVL 78

Expert Comment

ID: 40008212
Sure, if you are the one managing and cpanel is not involved.

Are you going to be using useradd to create local users?
LVL 78

Expert Comment

ID: 40008216
Here is a link to a setup that may over all your needs with your preferred mail server, sendmail.


Author Comment

ID: 40009051
Hi Arnold,

Well I may be getting close... I believe that Sendmail is 'Listening' but whenever I try to send email to a User on system I receive the following error message:

Delivery to the following recipient failed permanently:

Technical details of permanent failure:
Google tried to deliver your message, but it was rejected by the server for the recipient domain by [].

The error that the other server returned was:
550 No Such User Here


NOTE: Currently my SMTP from my personal machine is gmail...

Thanks for any insite that you may have

LVL 62

Expert Comment

ID: 40009532
Centos 6 has postfix in default installation.
I'd say it will be much easier to clean misguided sendmail stains and go on with much more robust and performant postfix
(it still has /usr/lib/sendmail and smtp on localhost, so it does not break anything)
LVL 78

Expert Comment

ID: 40009669
You have to look at your /etc/alias and depends on how your virtusertable is setup.

One deals with local users that are seen in /etc/passwd and have a home dir /home/$user/mail or /var/spool/mail/

without knowing how your setup is defines the user and their home directory, it is impossible to say where the issue might be.

The last link I posted deals with have /etc/alias lists with usernames mapped to


Author Comment

ID: 40009859
Ok... I am getting frustrated with Sendmail... I'll try to use Postfix...

Any help you can give me to get Postfix running would be appreciated.

One of the issues I see already with Postfix is that I can not install Mysql with 'Yum install mysql'

I'll do some reading and try to figure this out
  As always any help is appreciated

LVL 78

Expert Comment

ID: 40009961
yum install mysql-server
The above installs the server components
While mysql by itself installs the client side

Yum search mysql

Would list all available packages with mysql in the name.l

What if any error do you get?
Centos has group installs. Where you can use yum groupinstall "group name" that will install the multiple items making up the group.
yum groupinstall "mysql database"

Yum list groups
There are examples similar to the one I posted for mysql+sendmail+spamassasin+dovecote etc.

There are postfix, mysql, an anti-virus, amavis, spamassasin, etc install guide for centos, etc.

Since you switched, the log file is a way to trouble shoot issues as well /var/log/maillog.

The issue you likely were seems dealt with a user table such that you had an email defined and pointed it to a "user account" but that account did not exist as a local user, nor was defined in /etc/alias through which sendmail could
The other option if you've included an local delivery agent (LDA) such as procmail or any other filtering tool that ran into trouble when trying to save the message into a user's mailbox, the error code on exit could also trigger this error from sendmail.
LVL 62

Expert Comment

ID: 40010671
On postfix it accepts mail from localhost and listens on localhost...
Short stroll arount /etc/postfim/ should reveal hos wo
1) make it listen on any IP on system
2) accept mail from other IPs in your network
3) direct mail to smarthost...
LVL 78

Accepted Solution

arnold earned 500 total points
ID: 40010707
I'll answer in reverse,
smarthost is defined under relayhost=

You may have iptables enabled that are blocking incoming connections.
lsof -i:25 to see whether postfix is bound to a specific IP:25 or not
netstat -an | grep ':25'
provides the same result. LISTEN
:::25  LISTEN
means it listens on all IPs of the system.
iptables -L INPUT --line-numbers

iptables -I INPUT 4 -p tcp --dport 25 --j ACCEPT
The above will add an entry on line 4 pushing everything else one line down.  Accepts TCP traffic to destination port 25 without restriction.

For the second question accept mail from other IPs in your network has two implications one is addressed by the firewall change. The other presumably meaning you want to allow your LAN to relay through your mail server.  This is done via the variable assignment of mynetworks=

If you need a more granular control for your outgoing mail routing, instead of relayhost entry, you can use the transport rule (the two are mutually exclusive).
transport table (allows for directing specific domains to specific smart hosts/destinations: After modifying the transport smtp:IP:port

* smtp:IP:port
will be equivalent to smarthost/relay host functionality i.e. this will be the default rule

There are examples on how to configure postfix's outgoing client to use authentication/SSl/TLS if needed
i.e. the postfix client authnticates with your provider's mail servers if needed to transmit messages.

Author Comment

ID: 40010731
Hi Arnold...

It looks like I actually have a Corrupted or Bad install of CentOS and or CPanel.  I am getting a very large number attacks to my machine. I am going to award you the points for helping me but I am going to close this question for now.

I am going to get a New install of the OS and then if I still can't get things running, I'll again 'ASK'  for help...

Thanks for your time, and I am sorry to have wasted your time with a Corruption issue.


Author Closing Comment

ID: 40010734
Problem has not actually been resolved due to a corrupted OS. However, Arnold has been most helpful and Patient...

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
UM7 Stop Sending packets with GPS Sensor 1 45
Zimbra and Renewing SSL Certficate 9 63
Edit smb.conf-file in Samba om a ReadyNAS 3 76
Bash script to include windows servers 13 41
Fine Tune your automatic Updates for Ubuntu / Debian
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
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…
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

752 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