Post by amourinho » Thu Nov 26, 2020 6:34 am

Hi everyone! First post here, as I've given up on google and the previous posts here.
I've searched the previous posts regarding this matter or similar and tried all the suggested solutions, but have been unable to get things working.
I'm trying to get email functionality working for the store I'm setting up for a client via SMTP. Anyone else having this issue?

Removing the ssl:// or switching it to tls:// gives me the error `Error: EHLO not accepted from server!`. I'm certain I've followed the setup properly, but clearly there is an issue and I'm unable to trace what's going on. Any and all help is greatly appreciated!

I'm on OpenCart version 3.0.3.6, and below are pictures of my configuration and error log.

Opencart store mail settings
Image

Migadu server settings
Image

Nginx error log after submitting contact form
Image

Newbie

Posts

Joined
Mon Aug 07, 2017 5:06 am

Post by sw!tch » Thu Nov 26, 2020 6:45 am

Try tls:// in the hostname on port 587

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by amourinho » Thu Nov 26, 2020 6:54 am

Hi sw!tch, as you suggested,
I replaced ssh:// with tls://, and port 465, with 443 and it failed miserably lol.. No route to host
Image

I'm certain ssh:// and the port 465 are right, as at least it connects and it gets past the HELO portion.

Thank you for your suggestion, but it wasn't able to resolve my issue.

Newbie

Posts

Joined
Mon Aug 07, 2017 5:06 am

Post by sw!tch » Thu Nov 26, 2020 7:00 am

You tried 587?

Sometimes you need to contact your host, they will occasionally block SMTP connections from scripts.

Also try without the ssl:// or tls:// prefix.

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by amourinho » Thu Nov 26, 2020 7:05 am

Thanks again for the suggestions,
So I tried port 587 with tls prefix, and I got the same `MAIL FROM not accepted from server!` error as before.
I then removed the prefix, still with port 587, and I got `AUTH LOGIN not accepted from server!` (the email/password combination are correct)
Image

Newbie

Posts

Joined
Mon Aug 07, 2017 5:06 am

Post by sw!tch » Thu Nov 26, 2020 7:09 am

Try the recommend settings again, but also check that from email address matches the sender.

Ensure your DKIM and/or SPF records are setup per the provider as well.

My last guess.

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by amourinho » Thu Nov 26, 2020 7:23 am

Sorry I'm not quite sure I follow. Mind explaining that a little further?
The configuration on OpenCart matches my Migadu email account settings.

Newbie

Posts

Joined
Mon Aug 07, 2017 5:06 am

Post by sw!tch » Thu Nov 26, 2020 7:30 am

Sometimes if the the from email does not match that of the account email it wont authenticate.

So go under the store tab in the settings section and see if the email address match that of your SMTP account. Otherwise you need to work with your mail provider and web host, only so much can be debugged from a forum.

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by amourinho » Thu Nov 26, 2020 7:34 am

Hmm...
I set the email in the Store tab to match what I had in the Mail tab, and tried again with no ssl or tls prefix, and still using port 587.
I still get `AUTH LOGIN not accepted from server!`

Thanks anyways for your input! I really do appreciate the assistance.

Newbie

Posts

Joined
Mon Aug 07, 2017 5:06 am

Post by sw!tch » Thu Nov 26, 2020 7:38 am

Now try with the tls prefix on port 465. Keep in mind that too many failed attempts you could also be blocked for a bit.

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by ADD Creative » Thu Nov 26, 2020 7:42 am

For SMTP settings.
1. Use the ssl:// prefix in the SMTP Hostname and port 465.
This will tell OpenCart/PHP in use Implicit TLS encryption on port 465.
Or.
2. Use the tls:// prefix in the SMTP Hostname and port 587.
This will tell OpenCart/PHP to connect normally to port 587 and use the STARTTLS command to upgrade the connection to a secure one using TLS.
For.
Notice: Error: MAIL FROM not accepted from server!
It means the settings you have entered are correct, as this error is only generated after your username and password has been accepted.

What it does mean is that the mail server didn't like your store's email address. Check that your email address in System->Settings->Store (tab)->E-mail matches your email address in System->Settings->Mail (tab)->SMTP Username.

If it does match then you can get more information as to why it was rejected by changing line 242 of system/library/mail/smtp.php from:

Code: Select all

throw new \Exception('Error: MAIL FROM not accepted from server!');
To:

Code: Select all

throw new \Exception('Error: MAIL FROM not accepted from server! ' . $reply);

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by amourinho » Thu Nov 26, 2020 7:48 am

Back to `EHLO not accepted from server!` with those settings

Newbie

Posts

Joined
Mon Aug 07, 2017 5:06 am

Post by straightlight » Thu Nov 26, 2020 7:59 am

amourinho wrote:
Thu Nov 26, 2020 7:48 am
Back to `EHLO not accepted from server!` with those settings
Send me a direct PM via the forum, I'll take a look.

Dedication and passion goes to those who are able to push and merge a project.

Regards,
Straightlight
Programmer / Opencart Tester


Legendary Member

Posts

Joined
Mon Nov 14, 2011 11:38 pm
Location - Canada, ON

Post by ADD Creative » Thu Nov 26, 2020 10:26 am

amourinho wrote:
Thu Nov 26, 2020 7:48 am
Back to `EHLO not accepted from server!` with those settings
You must still have the settings wrong or something else has changed, as your previous posts you stated you received the "MAIL FROM not accepted from server!" error, which will only be generated if your details are correct and passed the EHLO test.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by amourinho » Fri Nov 27, 2020 5:13 am

ADD Creative wrote:
Thu Nov 26, 2020 7:42 am
For SMTP settings.
1. Use the ssl:// prefix in the SMTP Hostname and port 465.
This will tell OpenCart/PHP in use Implicit TLS encryption on port 465.
Or.
2. Use the tls:// prefix in the SMTP Hostname and port 587.
This will tell OpenCart/PHP to connect normally to port 587 and use the STARTTLS command to upgrade the connection to a secure one using TLS.
For.
Notice: Error: MAIL FROM not accepted from server!
It means the settings you have entered are correct, as this error is only generated after your username and password has been accepted.

What it does mean is that the mail server didn't like your store's email address. Check that your email address in System->Settings->Store (tab)->E-mail matches your email address in System->Settings->Mail (tab)->SMTP Username.

If it does match then you can get more information as to why it was rejected by changing line 242 of system/library/mail/smtp.php from:

Code: Select all

throw new \Exception('Error: MAIL FROM not accepted from server!');
To:

Code: Select all

throw new \Exception('Error: MAIL FROM not accepted from server! ' . $reply);
With `ssl://smtp.migadu.com` and port `465`, and the emails all matching, I was able to have my contact form send an email properly!
I must still have an issue somewhere however, because updating orders, and checking "notify customer" doesn't email them. There are no errors reported in the logs either.

I owe you all a huge amount of thanks for your help! Happy Thanksgiving to all my neighbors south of us!

Newbie

Posts

Joined
Mon Aug 07, 2017 5:06 am

Post by sw!tch » Fri Nov 27, 2020 5:27 am

If the end users are not receiving mail than also ensure your domain host/zone file has the proper DKIM and/or SPF records as required per the provider.

Also ensure all events prefixed with mail are enabled under admin->extensions-> events

Full Stack Web Developer :: Send a PM for Custom Work.
Backup and learn how to recover before you make any changes!


Active Member

Posts

Joined
Sat Apr 28, 2012 2:32 pm

Post by ADD Creative » Fri Nov 27, 2020 5:34 am

amourinho wrote:
Fri Nov 27, 2020 5:13 am
With `ssl://smtp.migadu.com` and port `465`, and the emails all matching, I was able to have my contact form send an email properly!
I must still have an issue somewhere however, because updating orders, and checking "notify customer" doesn't email them. There are no errors reported in the logs either.

I owe you all a huge amount of thanks for your help! Happy Thanksgiving to all my neighbors south of us!
Check in Extensions -> Events that"mail_order_add" is enabled and trigger is "catalog/model/checkout/order/addOrderHistory/before" also that "mail_order_alert" is enabled with a trigger of "catalog/model/checkout/order/addOrderHistory/before".

Could be the messages are being treated as spam. Check you have all the SPF and DKIM set up (use an online mail deliverability tool to check). Check your host doesn't run any outgoing mail filters. I'v seen hosts reject this sort of outgoing mail as spam.

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom

Post by amourinho » Fri Nov 27, 2020 10:05 pm

A final update as this thread can be closed.

ADD Creative your message led me to the issue. My events had only one trigger listed in it, just one for voucher.
I ended up redeploying a new OpenCart store, which had all the event triggers you'd mentioned enabled by default. I ported the products/categories/etc, images, and theme over. Everything appears to be in working order.

Thanks to all who helped, you're all a tremendous asset to this community!

Newbie

Posts

Joined
Mon Aug 07, 2017 5:06 am

Post by thomas.huerlimann » Mon Jun 28, 2021 2:53 am

I dont think this topic can be closed.

The domain we use is: domainxy.ch.

I have the same error in php_errors.log.

Code: Select all

[27-Jun-2021 18:18:33 UTC] PHP Fatal error:  Uncaught Exception: Error: MAIL FROM not accepted from server!
The error in the mailservers logfile:

Code: Select all

Jun 27 20:27:20 mail sendmail[28688]: 15RIRKe9028688: ruleset=check_mail, arg1=<domainxy.ch>, relay=somehost.local [10.0.1.1], reject=553 5.5.4 <domainxy.ch>... Domain name required for sender address domainxy.ch
We use a username that is not in the format of a email address to authenticate to the SMTP host. So the format of the username is "domainxy.ch" and _not_ "something@domain.xy".

We can not use SMTP AUTHENTICATION to authenticate to our SMTP host (anymore). We where forced to switch to IP based allowed relaying and we was forced to remove the username and password value from "SYSTEM -> SETTINGS -> Email -> SMTP Username and SMTP Password" - after this modification it was working again.

We was forced to change the SMTP settings after an upgrade from 3.0.3.2 to 3.0.3.7. The behaviour between 3.0.3.2 and 3.0.3.7 must have been changed.

It looks like OC uses the value from the "SMTP Username" as the FROM address to send emails and _not_ the configured email address at "SETTINGS -> STORE -> Email" anymore.


Posts

Joined
Mon May 13, 2019 10:44 pm

Post by ADD Creative » Mon Jun 28, 2021 5:59 am

The changed was made here https://github.com/opencart/opencart/pull/8096 to 3.0.3.7, along with some other bugs.

To put it back to the way it was / should be. You would need to change in system/library/mail/smtp.php.

Code: Select all

			if ($this->verp) {
				fputs($handle, 'MAIL FROM: <' . $this->smtp_username . '>XVERP' . "\r\n");
			} else {
				fputs($handle, 'MAIL FROM: <' . $this->smtp_username . '>' . "\r\n");
			}
To.

Code: Select all

			if ($this->verp) {
				fputs($handle, 'MAIL FROM: <' . $this->from . '>XVERP' . "\r\n");
			} else {
				fputs($handle, 'MAIL FROM: <' . $this->from . '>' . "\r\n");
			}

www.add-creative.co.uk


Expert Member

Posts

Joined
Sat Jan 14, 2012 1:02 am
Location - United Kingdom
Who is online

Users browsing this forum: jagall, JNeuhoff, SohBH and 249 guests