cancel
Showing results for 
Search instead for 
Did you mean: 

Hostopia SMTP Mail failing

spraxyt
Superuser
Superuser
Posts: 10,063
Thanks: 1,369
Fixes: 75
Registered: ‎06-04-2007

Hostopia SMTP Mail failing

On Hostopia ccgi I'm getting an SMTP connection failure when I try to send mail using phpmailer 5.2.9 with SMTP through 'localhost' .
Debug gives:
Connection: opening to localhost:25, t=300, opt=array ()
SMTP ERROR: Failed to connect to server: php_network_getaddresses: getaddrinfo failed: Name or service not known (0)
SMTP connect() failed.
I first noticed this late last night, but the problem is still present.
Using PHP mail() (which interfaces to sendmail) works OK.
David
David
7 REPLIES 7
bobpullen
Community Gaffer
Community Gaffer
Posts: 14,877
Thanks: 2,479
Fixes: 168
Registered: ‎04-04-2007

Re: Hostopia SMTP Mail failing

Replicated and raised with Hostopia (ref: 3658284). Apologies it took so long to pick up Embarrassed

Bob Pullen
Plusnet Product Team
If I've been helpful then please give thanks ⤵

bobpullen
Community Gaffer
Community Gaffer
Posts: 14,877
Thanks: 2,479
Fixes: 168
Registered: ‎04-04-2007

Re: Hostopia SMTP Mail failing

Hi David, I'm assuming things are still broken today? Hostopia say they've fixed the script I have uploaded to my webspace but from what I can ascertain, they've just switched to using PHPMail rather than SMTP.

Bob Pullen
Plusnet Product Team
If I've been helpful then please give thanks ⤵

spraxyt
Superuser
Superuser
Posts: 10,063
Thanks: 1,369
Fixes: 75
Registered: ‎06-04-2007

Re: Hostopia SMTP Mail failing

Yes, SMTP mail still fails with exactly the same error message. I use SMTP mail with phpList and this worked fine until the last few days,
As before sending using the php mail() function continues to work.
David
David
spraxyt
Superuser
Superuser
Posts: 10,063
Thanks: 1,369
Fixes: 75
Registered: ‎06-04-2007

Re: Hostopia SMTP Mail failing

To check if it made any difference I updated PHPMailer to version 5.2.10. Sending using SMTP on localhost continues to fail, but the error string now includes a reference to a Troubleshooting page.
Connection: opening to localhost:25, timeout=300, options=array ()
SMTP ERROR: Failed to connect to server: php_network_getaddresses: getaddrinfo failed: Name or service not known (0)
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
After reviewing that page DNS lookups seemed a likely source of the problem. This was confirmed by replacing 'localhost' with '127.0.0.1' in my code; with that change SMTP sending works again. Smiley
Until recently 'localhost' used to work - so what has changed? This is only a guess but I suspect Hostopia DNS now supports IPv6 with IPv6 preferred.. This implies the IP returned for 'localhost' will be '::1'. I suspect the problem is that opening a socket to port 25 using that IPv6 address then fails. Sad
David
David
bobpullen
Community Gaffer
Community Gaffer
Posts: 14,877
Thanks: 2,479
Fixes: 168
Registered: ‎04-04-2007

Re: Hostopia SMTP Mail failing

Nicely spotted David.
I've changed localhost to the loopback IP in my own script and it works.
I've provided Hostopia with this diagnosis and am awaiting a response from them.

Bob Pullen
Plusnet Product Team
If I've been helpful then please give thanks ⤵

bobpullen
Community Gaffer
Community Gaffer
Posts: 14,877
Thanks: 2,479
Fixes: 168
Registered: ‎04-04-2007

Re: Hostopia SMTP Mail failing

Looks to be working now David. Can you confirm?
SMTP -> FROM SERVER:220 web86c50 ESMTP Sendmail 8.14.4/8.12.6/SuSE Linux 0.6; Tue, 18 Aug 2015 12:44:01 GMT
SMTP -> FROM SERVER: 250-web86c50 Hello localhost [127.0.0.1], pleased to meet you 250-ENHANCEDSTATUSCODES 250-PIPELINING 250-8BITMIME 250-SIZE 250-DSN 250-ETRN 250-DELIVERBY 250 HELP
SMTP -> FROM SERVER:250 2.1.0 ... Sender ok
SMTP -> FROM SERVER:250 2.1.5 ... Recipient ok
SMTP -> FROM SERVER:354 Enter mail, end with "." on a line by itself
SMTP -> FROM SERVER:250 2.0.0 t7ICi1BD021074 Message accepted for delivery
SMTP -> FROM SERVER:221 2.0.0 web86c50 closing connection
Message sent!

You were right BTW, it was a local DNS issue.

Bob Pullen
Plusnet Product Team
If I've been helpful then please give thanks ⤵

spraxyt
Superuser
Superuser
Posts: 10,063
Thanks: 1,369
Fixes: 75
Registered: ‎06-04-2007

Re: Hostopia SMTP Mail failing

Thanks. I can confirm that sending using 'localhost' as the SMTP host works again.
So problem fixed. Smiley
David
David