Solved

Need Help getting Sendmail to ACCEPT mail on CentOS 6

Posted on 2014-04-17
16
716 Views
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 h72-2-20-183.bigpipeinc.com (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.

rrbecker
Rick
0
Comment
Question by:rrbecker
  • 8
  • 6
  • 2
16 Comments
 
LVL 76

Expert Comment

by:arnold
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.
http://sendmail-sql.sourceforge.net

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 http://docs.cpanel.net/twiki/bin/view/AllDocumentation/CpanelDocs/AddonDomains
0
 
LVL 2

Author Comment

by:rrbecker
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??

Rick
0
 
LVL 76

Expert Comment

by:arnold
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.
0
 
LVL 76

Expert Comment

by:arnold
ID: 40008146
You've likely looked at it: http://docs.cpanel.net/twiki/bin/view/AllDocumentation/CpanelDocs/WebHome

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.
0
 
LVL 2

Author Comment

by:rrbecker
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??

Rick
0
 
LVL 76

Expert Comment

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

https://www.sendmail.com/sm/open_source/tips/virtual_hosting/


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

Expert Comment

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

Http://www.linuxscrew.com/2011/02/07/sendmail-for-virtual-users-with-procmail-spamassassin-and-dovecot/
0
 
LVL 2

Author Comment

by:rrbecker
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:

     vasylum@verilynx.com

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

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

Rick
0
Don't lose your head updating email signatures!

Do your end users still have the wrong email signature? Do email signature updates bore you or fill you with a sense of dread? You can make this a whole lot easier on yourself by trusting an Exclaimer email signature management solution. Over 50 million users do...so should you!

 
LVL 61

Expert Comment

by:gheist
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)
0
 
LVL 76

Expert Comment

by:arnold
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
/var/spool/domainname/user


etc.
0
 
LVL 2

Author Comment

by:rrbecker
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

Rick
0
 
LVL 76

Expert Comment

by:arnold
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.
0
 
LVL 61

Expert Comment

by:gheist
ID: 40010671
On postfix it accepts mail from localhost and listens on localhost...
Short stroll arount /etc/postfim/main.cf 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...
0
 
LVL 76

Accepted Solution

by:
arnold earned 500 total points
ID: 40010707
I'll answer in reverse,
in main.cf
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.
0.0.0.0:25 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
domain1.com 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.
0
 
LVL 2

Author Comment

by:rrbecker
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.

Rick
0
 
LVL 2

Author Closing Comment

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

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Are you using email marketing software? If not, you're missing out on effortless marketing and the reaching of desired conversion rates through email marketing software.
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
In this Experts Exchange video Micro Tutorial, I'm going to show how small business owners who use Google Apps can save money by setting up what is called a catch-all email address in their Gmail accounts. By using the catch-all feature, small busin…

743 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

12 Experts available now in Live!

Get 1:1 Help Now