Jump to content

CC 5.2.5 SMTP Port 25 Email with Authentication


SimChris

Recommended Posts

Hi, folks

long time CC user; moved to new server still trying to iron out some wrinkles. Self hosted (we have 'the power'), but ran into one gotcha which is unable to send email via SMTP.

 

All the usual suspect settings

 

Use SMTP

Port 25

mail.ourdomain.xyz

smtp username = orders

password = ****

 

use SMTP authentication = YES.

 

Trying a test email (newsletter "just a test" and also "recover lost password') do not seem to get the mail out. There is no store "error log" for unsent email either it seems (e.g., via debug, or store error log).

 

We have dedicated IP for domain also which makes life simpler.

 

Has anybody else sorted this one out? Port 25 appears open for the site/domain/server, but nothing going out. Create a new port to use SSL/TLS and hack the mail file per Bsmithers other post.... or ?

 

We obviously want to use SMTP to have @ourstore emails in header vs having apache(at)ourdns.xyz which look really dumb on a dedicated store/site/SSL setup.

 

Linux/PHP5.4/CentoS 6.5(final)/Plesk 11 latest.

 

Is there any email error log for store, or just the server side stuff?

Link to comment
Share on other sites

"Is there any email error log?"

 

Yes. Mostly.

 

email() method:

You say you "have the power", so I will conclude you can edit the PHP.INI file for the server. I will also conclude that your self-hosted server has a mailer installed (sendmail?). Also, this server runs the Linux operating system.

 

The relevant part of the PHP.INI file is:

[mail function]
; For Unix only.  You may supply arguments as well (default: "/usr/sbin/sendmail -t -i").
; http://php.net/sendmail-path
;sendmail_path =

; The path to a log file that will log all mail() calls. Log entries include
; the full path of the script, line number, To address and headers.
;mail.log =
; Log mail to syslog (Event Log on NT, not valid in Windows 95).
;mail.log = syslog
 

So, once you know what mailer you are using, if any, and commands to add to the command line, you can specify the address to make the emails appear to be sent from (as well as any other aspect of getting mails sent).

 

You can set the mail.log to point to a file that you can, on occasion, FTP to your workstation.

 

N.B.: CubeCart still uses PHPMailer when the store settings says to use mail(). PHPMailer manages the process and, in turn, uses PHP's mail() function.

 

SMTP method:

Now, since you say that the SMTP method of getting emails sent, even when using the special port numbers to engage encryption, apparently aren't getting out, we need to see where to activate a PHPMailer debugger.

 

(I have not tested this:) In the file /classes/mailer.class.php, at about line 34, enter onto the blank line this:

$this->SMTPDebug = 3;

 

Unfortunately, CC525 uses PHPMailer 5.1 (latest version is 5.2.7) which has no capability to log the debug output to anywhere other than echo'ing it to the output sent to the browser.

 

 

Hopefully, this gets you a place to start.

Link to comment
Share on other sites

Groovy. Just as an aside, we're running another app for client mailing lists "phplist" which works perfectly fine for sending emails; we're on Linux, and Postfix as Qmail is security hole.

 

I have been reading some issues online with Plesk 11 where SMTP "stops working" after update, and on send generates

 

 

Server Error 530

Must issue a STARTTLS command first

server mail.xxxx.tld

protocol SMTP

Port 587

Secure (SSL) No

 

So the issue with SMTP seems to be that for port 587 a STARTLS command is needed. Not sure if store does that or not, or the copy of phpmailer you're setup with or config'd.

 

For authentication obviously it needs to ping before send with POP3 before SMTP "on" -- right? Hence the username/password.

 

Sendmail works perfectly fine. IMAP pop email from PC works fine (port 993). PHPList using phpmailer also, works fine.

 

Only having issue with store not being able to send via SMTP through any mix of settings from store panel.

 

A secure TLS/SSL option would be nice for port 587 also. Or, even a config file which could be hand coded with local settings.

 

Will mess with it some more here.

 

Hi, AL ... having the latest version with a debug mode would be super duper awesome! :-)

 

I need to double double check port 587 is actually setup on the new server for our main ecom domain (sigh .... luckily this stuff generally only needs sorted once then I can ignore for four years ... went though all kinds of stuff last year tweaking old server for the most arcane pci-dss stuff - tried to copy all that to new box for consistency ... and this one is the last remaining "me so clueless" moment ...)

 

Stupid Win7/IE11 won't let me copy/paste into this forum now (sheesh). 

 

New version of phpmail also adds a pop before smtp test for devs, which is nice.

Link to comment
Share on other sites

I believe that from this conversation, I can conclude that your port 587 which is ESMTP Postfix is local to your server?

 

If so, then:

  • keep the added line discussed >here
  • choose SMTP as the mail method in admin
  • enter 'localhost' as the host

Hopefully, localhost is a valid entry, and your server's mailer (whatever it may be) is listening to port 587. The code in the file /classes/phpMailer/class.phpmailer.php, near lines 797-817 indicate to me that StartTLS() will be executed when PHPMailer is using SMTP to mail.

Link to comment
Share on other sites

Hi all ...
I was dealing with other issues related to the move to new hardware over holiday, configuring mod_pagespeed, and also an issue with phplist where an old setting in php had memory set to 256MB vs 256M and it carried over from old box to new with migration and so was doing 256 bytes and so phplist wouldn't send stuff. Whew. I'll be circling back to this issue on our server to sort out the port 587 vs port whatever in a bit. Mail has gotten trickier when using php in the nextgen setups with all email needing to be SSL, and it looks like even with phplist we're going to have to switch from port 110 for bounces over to 995.

 

We have phplist working for newsletters and whatnot. Next will be CC5.2.5 to see if we can use SMTP properly.

 

Thanks bsmither (as always) and Al for your generous time on providing help.

 

Will post update once I have a free brain cell. I worked every day the past 15 days, and last night went to bed at 10 slept until 11 today. Brain dead. (call  the waaambulance!)  ;-)

 

More later ...!

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.

×
×
  • Create New...