Solved

Websites not sending Email

Posted on 2014-10-15
22
180 Views
Last Modified: 2014-11-09
Hi Folks

Another one that's causing me no end of headache. I have moved a customer's web sites from one cPanel server to another and the move went fine. However, they are saying that their sites are not sending Emails, for example from the contact form, etc.

When the sites were on the old server, everything worked fine but I have absolutely no idea where to look or what to look for.

Server is a CentOS 6.5 server with WHM / cPanel installed.

Any help would be gratefully accepted. I really need to get back to them with some sort of resolution as soon as possible.

Cheers
Chris
0
Comment
Question by:kenwardc
  • 13
  • 6
  • 3
22 Comments
 
LVL 58

Expert Comment

by:Gary
Comment Utility
Do they have a mail server installed and started?
Is this a VPS?
0
 

Author Comment

by:kenwardc
Comment Utility
Hi Gary

We are the host. The server is a VPS and is running Dovecote locally and Exim etc as normal when cPanel. The odd thing is that we are running so many of these type of servers and this is the only one doing this. We have pored over so many configs but cannot see what is wrong, hence the question here.

Hope you can help.

Cheers
Chris
0
 
LVL 58

Expert Comment

by:Gary
Comment Utility
Could be a number of things, have you checked the mail logs - any clues there?
Start with checking if the email is even being attempted to be sent.
Are the ports open in the firewall.
If you restart the mail server manually are there any errors reported.
0
 

Author Comment

by:kenwardc
Comment Utility
Hi Gary
Mail from root is going out fine. I can telnet from the server on port 25 to outside mail servers both using root and one of the web accounts. The exim_mainlog shows localhost@localdomain  and then QUIT, which I'm a little concerned about and it does this when one of the websites is trying to send mail.

Does this help at all?
0
 

Author Comment

by:kenwardc
Comment Utility
The server is running csf but there again so are all our other servers...
0
 
LVL 58

Expert Comment

by:Gary
Comment Utility
Check your hosts file, the email is very likely getting rejected with that address (not likely - it will be)

Can you give the site address to check?

Are they actually setting a from address?
0
 

Author Comment

by:kenwardc
Comment Utility
Hosts file looks fine. I'll post a copy tomorrow morning for you. Site address is mersey.tgis.co.uk
0
 

Author Comment

by:kenwardc
Comment Utility
Bear in mind we won't accept incoming mail and this problem is all about outgoing mail?
0
 
LVL 58

Expert Comment

by:Gary
Comment Utility
So this is a sub domain of your site.
Hmmmm, your mail server is probably rejecting the email unless it is in it's own lists. (I would hope it is rejecting it)

What from address are they using?
0
 
LVL 11

Expert Comment

by:RedLondon
Comment Utility
In WHM, under the Email section, use the Email Delivery Reports to search for the account's username (type their username into the first box, select "User" from the pulldown menu) and look in the results for one of the emails that their form has sent - it'll show if the email is being rejected

If not, perhaps the email isn't being sent - if the account has transferred from another server perhaps the page trying to send the emails is using some absolute path that worked on the old server and doesn't work on the new one?  The log at /usr/local/apache/logs/error_log should show errors that gives clues what is going wrong when you use the contact form to send an email.  At the command line if you use the command "tail -f /usr/local/apache/logs/error_log" in one window and submit a test message on their form at the same time you'll see the error in realtime
0
 

Author Comment

by:kenwardc
Comment Utility
Hi RedLondon

If I send using the MAIL command, it all seems to work just fine and the message goes out. If I fill in a contact form on the website nothing happens in the error_log but in the exim_mainlog I get:

2014-10-16 08:55:55 SMTP connection from [127.0.0.1]:39500 (TCP/IP connection count = 1)
2014-10-16 08:55:56 SMTP connection from localhost.localdomain (localhost) [127.0.0.1]:39500 closed by QUIT
2014-10-16 08:55:57 cwd=/etc/csf 2 args: /usr/sbin/exim -bpc

Does this help in any way?

Cheers
Chris
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
LVL 11

Expert Comment

by:RedLondon
Comment Utility
Doesn't help me, but I think it's less to do with the mail system on your server and more to do with the website

I tried sending an email through the Send to a Friend - it took over 30 seconds before it said the email was sent (and of course nothing arrived).  It looks like you're using CakePHP, I've never seen that before but the email config notes are at http://book.cakephp.org/2.0/en/core-utility-libraries/email.html#configuration

Is that file holding details about another server by any chance?
0
 

Author Comment

by:kenwardc
Comment Utility
Hi RedLondon

I think we may be getting somewhere. I was wondering also why the forms took so long to execute and now a little light bulb has come on in my head. The only difference between the account for this web customer on the old server and on the new server is their account password, which I have changed.

If cake uses a password, then perhaps it's that causing the problem? <fingers crossed>

If this is the case, where in the cake setup would I change the password for the account?

Cheers
Chris
0
 
LVL 11

Expert Comment

by:RedLondon
Comment Utility
I don't know, sorry - I've never used it before.  If the CakePHP docs at the link above can't help, perhaps you're best off with a new question more along the lines of "I've inherited a CakePHP site and changed servers, why can't it send email" kind of thing to attract someone who does know?
0
 

Author Comment

by:kenwardc
Comment Utility
RedLondon, thanks for the input - much appreciated.

Cheers
Chris
0
 

Author Comment

by:kenwardc
Comment Utility
Hi again, everyone

I was beginning to wonder whether this is something to do with outgoing firewall (CSF) so added the account which need to be able to bypass the SMTP_BLOCK to the allowed file. That didn't work.

Now I'm wondering if it's something to do with the fact that the site uses Sendgrid for mail delivery... If anyone has experience with setting up and sending via Sendgrid, I'd love to hear from you..

Cheers
Chris
0
 

Author Comment

by:kenwardc
Comment Utility
Hi Folks

So.... mail is still not going anywhere and there don't appear to be any new entries in the "tailed" logs on the system when an Email is sent.

Our customer is definitely using Cake and all mail should be going out to Sendgrid for delivery. I've looked for Sendgrid login and password and have found them and verified they are good.

I've had a look at the Exim manager advanced section and it's a little scary so I haven't done much in there other to add the default username and password for Sendgrid. Still not working.

CSF/LFD has the account set as an "allowed to send out via SMTP" to get past the SMPT_BLOCK settings.

Help! ;)

Cheers
Chris
0
 

Author Comment

by:kenwardc
Comment Utility
Ok Folks - yet another update for you. I've added Exim setup for Sendgrid in all sections (Authenticor, Router and Transport) and restarted Exim. Then back to the website contact page and tried again. The Exim_mainlog says this:

2014-10-16 13:25:37 cwd=/var/spool/exim 2 args: /usr/sbin/exim -q
2014-10-16 13:25:37 Start queue run: pid=2632
2014-10-16 13:25:37 1Xek0t-0000Ya-Cr Message is frozen
2014-10-16 13:25:37 End queue run: pid=2632
2014-10-16 13:25:38 SMTP connection from [127.0.0.1]:40268 (TCP/IP connection count = 1)
2014-10-16 13:25:38 SMTP connection from localhost.localdomain [127.0.0.1]:40268 lost (error: Connection reset by peer)
2014-10-16 13:26:27 cwd=/etc/csf 2 args: /usr/sbin/exim -bpc
2014-10-16 13:26:51 SMTP connection from [127.0.0.1]:40281 (TCP/IP connection count = 1)
2014-10-16 13:26:52 SMTP connection from localhost.localdomain (localhost) [127.0.0.1]:40281 closed by QUIT
 
Aaargh! I don't know whether the connection from localhost.localdomain is a problem but still happening. There is a relaydomains file which has the localhost.localdomain on the 1st line with the sending domain on the second line. Does this make any difference?

Cheers
Chris
0
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
Comment Utility
This
error: Connection reset by peer

...means the remote server dropped the connection known as we don't want to talk to you.

Are there any mails in the mail directory waiting to be sent?
0
 

Author Comment

by:kenwardc
Comment Utility
Hi Gary

Nossir - nowt!

Cheers
Chris
0
 
LVL 58

Expert Comment

by:Gary
Comment Utility
Then the form is not actually sending an email to start with, if there was an email being sent they would be queued for sending.
0
 

Author Comment

by:kenwardc
Comment Utility
I've asked the web designer who created the site if he'll check at Sendgrid whether any mail is arriving. Will update you all when I hear from him. Many thanks for the suggestions so far folks.

Cheers
Chris
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

1. Introduction As many people are interested in Linux but not as many are interested or knowledgeable (enough) to install Linux on their system, here is a safe way to try out Linux on your existing (Windows) system. The idea is that you insta…
It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to selectively show certain fields based on user input using rules to gather relevant information and data from your forms. The rules feature provides you with an opportunity…

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

18 Experts available now in Live!

Get 1:1 Help Now