Link to home
Start Free TrialLog in
Avatar of Chris Kenward
Chris KenwardFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Websites not sending Email

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
Avatar of Gary
Gary
Flag of Ireland image

Do they have a mail server installed and started?
Is this a VPS?
Avatar of Chris Kenward

ASKER

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
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.
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?
The server is running csf but there again so are all our other servers...
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?
Hosts file looks fine. I'll post a copy tomorrow morning for you. Site address is mersey.tgis.co.uk
Bear in mind we won't accept incoming mail and this problem is all about outgoing mail?
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?
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
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
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?
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
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?
RedLondon, thanks for the input - much appreciated.

Cheers
Chris
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
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
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
ASKER CERTIFIED SOLUTION
Avatar of Gary
Gary
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi Gary

Nossir - nowt!

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