Jump to content

SMTP Authentication


raytowle
 Share

Recommended Posts

Hi

First time posting, so please bear with me if i missing anything....
I have been having issues with CubeCart SMTP functionality. 

When filling in the form for the mail settings, and then sending a test email, I get an error saying "could not connect to server". This has had me stumped for a couple of days - until I realised that the tests are not trying to connect with the host that I have specified in the SMTP host field. 

I use office 365 SMTP so their mail server is smtp.offic365.com which uses TLS and port 587. However, every time I verify these details and attempt a test email - I get a response from the server where the website is hosted on - not office 365's mail server.

I have raised this with the web host provider, and they have assured me that because I am specifying the host "smtp.office365.com", the problem isnt with their server.... I feel like i'm going round in circles, but the SMTP response deffinitely does not come from the server I put in to the smtp host section in CubeCart. Just for the records, I've also tried googles smtp server and that doesnt go through either... that also responds with my hosts server - not the one I enter in the smtp host box on CubeCart....

These are the first few lines of the failed test email button (i have replaced the real domain with sub.domain for security reasons...):

SERVER -> CLIENT: 220-figo.dnetdns.com ESMTP Exim 4.89_1 #1 Fri, 11 May 2018 17:58:47 +0000 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail.
CLIENT -> SERVER: EHLO sub.domain.co.uk
SERVER -> CLIENT: 250-figo.dnetdns.com Hello sub.domain.co.uk [31.193.140.218]250-SIZE 52428800250-8BITMIME250-PIPELINING250-AUTH PLAIN LOGIN250-STARTTLS250 HELP
CLIENT -> SERVER: STARTTLS
SERVER -> CLIENT: 220 TLS go ahead
CLIENT -> SERVER: EHLO sub.domain.co.uk

I would expect my response to come back with something like:

SERVER -> CLIENT: 220 LO2P265CA0060.outlook.office365.com Microsoft ESMTP MAIL Service ready at Sat, 10 Feb 2018 21:45:11 +0000
 

Sooo. has any one any ideas?

Link to comment
Share on other sites

Being blocked would get a different error response. Initially you said "Could not connect to server". Then you said the test response is saying it is connecting, but to the wrong server. Maybe in PHPMailer's eyes, that's the same error.

Open the admin template settings.index.php for editing. At the very end, add {debug}. Save.

Request the Store Settings page. Your browser will want to throw a popup window. Let it. (You may need to re-request that page as the popup may contain the entire page, which we don't want.)

In the left pane of the popup, scroll to $CONFIG. In the right pane, find the group of settings related to the email settings. Verify host and port.

Edited by bsmither
Link to comment
Share on other sites

1 minute ago, Al Brookbanks said:

@raytowle sounds like you are technically minded. On those grounds why not order a VPS you have 100% controller of.

Checkout DigitalOcean, Linode & Vultr (amongst others). 

Literally thinking about a VPS right now..... does it have to be linux, or can it be windows? Im fairly ok with linux, but i know windows better.....

Link to comment
Share on other sites

1 minute ago, Al Brookbanks said:

I'd chose CloudLinux with cPanel. Or CentOS with cPanel to save cash.

@bsmither would say Windows.

Either is ok really but CubeCart is more geared to Linux and I hate Windows personally.

Great - i'll explore the linux options there then :) thanks.

Link to comment
Share on other sites

  • 2 weeks later...

Hi.

So, after some time, I've created a LAMP server on Linux.

The server is installed with CubeCart 6.2.0

I haven't made any changes to anything other than the mail server settings, of which have been set to Office 365's SMTP settings with TLS, but still get a very similar response when trying to send a test email:

 

 

SERVER -> CLIENT: 220 DM5PR19CA0021.outlook.office365.com Microsoft ESMTP MAIL Service ready at Thu, 17 May 2018 17:50:34 +0000
CLIENT -> SERVER: EHLO 23.100.78.132
SERVER -> CLIENT: 250-DM5PR19CA0021.outlook.office365.com Hello [23.100.78.132]250-SIZE 157286400250-PIPELINING250-DSN250-ENHANCEDSTATUSCODES250-STARTTLS250-8BITMIME250-BINARYMIME250-CHUNKING250 SMTPUTF8
CLIENT -> SERVER: STARTTLS
SERVER -> CLIENT: 220 2.0.0 SMTP server ready
CLIENT -> SERVER: EHLO 23.100.78.132
SERVER -> CLIENT: 250-DM5PR19CA0021.outlook.office365.com Hello [23.100.78.132]250-SIZE 157286400250-PIPELINING250-DSN250-ENHANCEDSTATUSCODES250-AUTH LOGIN XOAUTH2250-8BITMIME250-BINARYMIME250-CHUNKING250 SMTPUTF8
CLIENT -> SERVER: AUTH LOGIN
SERVER -> CLIENT: 334 XXXXXXXXXXXXXXXX
CLIENT -> SERVER: XXXXXXXXXXXXXXXXXX
SERVER -> CLIENT: 334 XXXXXXXXXXXXXXXXXXX
CLIENT -> SERVER: XXXXXXXXXXXXXXX
SERVER -> CLIENT: 535 5.7.3 Authentication unsuccessful [DM5PR19CA0021.namprd19.prod.outlook.com]
SMTP ERROR: Password command failed: 535 5.7.3 Authentication unsuccessful [DM5PR19CA0021.namprd19.prod.outlook.com]
SMTP Error: Could not authenticate.
CLIENT -> SERVER: QUIT
SERVER -> CLIENT: 221 2.0.0 Service closing transmission channel
SMTP connect() failed.
 
I've spoken to Office 365 support and I also have a NAS and some separate backup software which can authenticate successfully using Office 365, so I am now wondering if there is something which needs tweaking in CubeCart or if there's something obvious I'm missing?
 
Any help would be hugely appreciated as I'm now scratching my head on this one.
 
Ray
 
Edited by raytowle
Link to comment
Share on other sites

In your post above, make an edit to it so that the hashes are X'd out.:

SERVER -> CLIENT: 334 VXNlcm5hbWU6
CLIENT -> SERVER: XXXXXXXXXXXXXXXXX
and the pair following

Those hashes are simple encodings that contain your email username and password.

Link to comment
Share on other sites

2 minutes ago, bsmither said:

In your post above, make an edit to it so that the hashes are X'd out.:

SERVER -> CLIENT: 334 VXNlcm5hbWU6
CLIENT -> SERVER: XXXXXXXXXXXXXXXXX
and the pair following

Those hashes are simple encodings that contain your email username and password.

Ok, Sorry, Didn't realise... I thought this was hashed out.

Link to comment
Share on other sites

So, the conversation between client and server appears normal.

There doesn't appear to be any hidden spaces before or after the username or password (a common problem), but double-check anyway. The rejection notice specifically mentions the password failed. (Although, that phrase seems overly generic.)

The next point of unauthorized usage could be that Office365 (an Exchange-based server?) restricts access based on IP address - but you say your NAS and backup app can use SMTP and they, I assume, are seen on the same IP address.

I also assume the Office365 support had no relevant suggestions.

Edited by bsmither
Link to comment
Share on other sites

Hi. 

So, after a LOT of head scratching and reading through TLS / opensll article / php info etc, I have made some progress using phpmailer and changing the default settings in the php mailer config file which resulted in a test email being sent and successfully received. 

However - my working tests didnt last long and every time I now run the 'test email' - I get an error: "Testing PHP mail() Function. Test failed to execute."

Is this normal? Or is this a red herring?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...