Symbol: SUBJ_EXCESS_BASE64(1.50)
Symbol: FROM_EXCESS_BASE64(1.50)
Symbol: MIME_BASE64_TEXT_BOGUS(1.00)
Symbol: MIME_BASE64_TEXT(0.10)
Symbol: CTYPE_MIXED_BOGUS(1.00)
Symbol: R_PARTS_DIFFER(0.37)
Symbol: MISSING_MID(2.50)
We are doing nothing fancy and these scores seem to indicate basic mail headers.
The MISSING_MID(2.50) indicates a missing Message-ID header for instance.
https://stackoverflow.com/questions/144 ... ent-by-php
There also seem to be problems with the base64_encoded parts in To, From, Reply To and Subject?
I believe this has been reported before.
https://github.com/opencart/opencart/pull/7440
I am not in control of the mail server so I have asked them to check why the message-id is not being set.
As for the utf8_encode parts... Spamassassin seems to think that is indicative of somebody trying to be spammer.
Not sure if that is OpenCart's problem (don't think so).
The same with the missing Message-ID header. If spam filters give it such a large weight and the addition of a message-id field when none appears is only something a MTA MAY add. Then it would be best for OpenCart to set this.
Have you tried using the "Mail" Mail Engine to see if that adds the Message-ID header?
Could be that OpenCart needs to optimise the emails that are sent as it seems that email delivery systems are getting stricter and stricter these days.ADD Creative wrote: ↑Wed Jul 07, 2021 2:17 amI think it is an OpenCart problem. If spam filters put such a large weight to it being spam then unnecessarily Base64 encoding should be avoided.
The same with the missing Message-ID header. If spam filters give it such a large weight and the addition of a message-id field when none appears is only something a MTA MAY add. Then it would be best for OpenCart to set this.
Have you tried using the "Mail" Mail Engine to see if that adds the Message-ID header?
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
Also, mails using outlook.com, hotmail.com, live.com, or msn.com tend to be more likely to be treated as spam. It's better to use domain-name specific email accounts. Besides, the MS-based services frequently violate the GDPR rules, by automatically sniffing out the actual mail contents for purposes other than a mail delivery.Could be that OpenCart needs to optimise the emails that are sent as it seems that email delivery systems are getting stricter and stricter these days.
Export/Import Tool * SpamBot Buster * Unused Images Manager * Instant Option Price Calculator * Number Option * Google Tag Manager * Survey Plus * OpenTwig
Instructions for setting up SPF and DKIM in cPanel (it's simple)
https://core.evolvewebhost.com/knowledg ... entication
Opencart Hosting Plans, Domain Registration, Microsoft and Google Email and More
Visit our website for great deals and most importantly, fast and friendly support - www.evolvewebhost.com
It encodes all emails as base54 and the anti spam measures used by my (and many other) service providers does not allow unnecessary base64 encoding.
This is causing a big problem and OPENCART - not the users or the service providers - need to sort this out.
At the moment I have a shop which doesn't contact the customers.
My service provider was stopping unnecessary base64 encoding as an anti spam measure, but recent emails have not been stopped, therefore I think it is a suitable stop gap until Open Cart fix the issue.
I am not an expert by any means, and I do not know if this will cause problems, however testing has shown that emails continue to be sent without any obvious issues.
My smtp.php file is now (all old code commented out) ;
Code: Select all
<?php
namespace Mail;
class Smtp {
public $smtp_hostname;
public $smtp_username;
public $smtp_password;
public $smtp_port = 25;
public $smtp_timeout = 5;
public $verp = false;
public function send() {
if (is_array($this->to)) {
$to = implode(',', $this->to);
} else {
$to = $this->to;
}
$boundary = '----=_NextPart_' . md5(time());
$header = 'MIME-Version: 1.0' . PHP_EOL;
$header .= 'To: <' . $to . '>' . PHP_EOL;
/*$header .= 'Subject: =?UTF-8?B?' . base64_encode($this->subject) . '?=' . PHP_EOL;*/
/*NEW*/ $header .= 'Subject: ' . $this->subject . ' <' . PHP_EOL;
$header .= 'Date: ' . date('D, d M Y H:i:s O') . PHP_EOL;
/*$header .= 'From: =?UTF-8?B?' . base64_encode($this->sender) . '?= <' . $this->from . '>' . PHP_EOL;*/
/*NEW*/ $header .= 'From: ' . $this->sender . ' <' . $this->from . '>' . PHP_EOL;
if (!$this->reply_to) {
/*$header .= 'Reply-To: =?UTF-8?B?' . base64_encode($this->sender) . '?= <' . $this->from . '>' . PHP_EOL;*/
/*NEW*/ $header .= 'Reply-To: ' . $this->sender . ' <' . $this->from . '>' . PHP_EOL;
} else {
/*$header .= 'Reply-To: =?UTF-8?B?' . base64_encode($this->reply_to) . ' ' . $this->reply_to . '>' . PHP_EOL;*/
/*NEW*/ $header .= 'Reply-To: ' . $this->reply_to . ' <' . $this->reply_to . '>' . PHP_EOL;
}
$header .= 'Return-Path: ' . $this->from . PHP_EOL;
$header .= 'X-Mailer: PHP/' . phpversion() . PHP_EOL;
$header .= 'Content-Type: multipart/mixed; boundary="' . $boundary . '"' . PHP_EOL . PHP_EOL;
if (!$this->html) {
$message = '--' . $boundary . PHP_EOL;
$message .= 'Content-Type: text/plain; charset="utf-8"' . PHP_EOL;
$message .= 'Content-Transfer-Encoding: 8bit' . PHP_EOL . PHP_EOL;
$message .= $this->text . PHP_EOL;
EVERYTHING ELSE AS ORIGINAL
add a private function to the class system/library/mail/smtp.php
Code: Select all
// return base64 encoded if needed ($item not ASCII)
private function mailb64_if_required ($item) {
return (!mb_check_encoding($item, 'ASCII') ? '=?UTF-8?B?' . base64_encode($item) . '?=' : $item);
}
Code: Select all
$header .= 'Subject: =?UTF-8?B?' . base64_encode($this->subject) . '?=' . PHP_EOL;
Code: Select all
$header .= 'Subject: ' . $this->mailb64_if_required($this->subject) . PHP_EOL;
Code: Select all
$header .= 'From: =?UTF-8?B?' . base64_encode($this->sender) . '?= <' . $this->from . '>' . PHP_EOL;
Code: Select all
$header .= 'From: ' . $this->mailb64_if_required($this->sender) . ' <' . $this->from . '>' . PHP_EOL;
Code: Select all
$header .= 'Reply-To: =?UTF-8?B?' . base64_encode($this->sender) . '?= <' . $this->from . '>' . PHP_EOL;
Code: Select all
$header .= 'Reply-To: ' . $this->mailb64_if_required($this->sender) . ' <' . $this->from . '>' . PHP_EOL;
Code: Select all
$header .= 'Reply-To: =?UTF-8?B?' . base64_encode($this->sender) . '?= <' . $this->reply_to . '>' . PHP_EOL;
Code: Select all
$header .= 'Reply-To: ' . $this->mailb64_if_required($this->sender) . ' <' . $this->reply_to . '>' . PHP_EOL;
So you do not have to constantly do:
Code: Select all
if (mb_check_encoding($this->xxxxxx, 'ASCII')) {
} else {
}
DISCLAIMER:
You should not modify core files .. if you would like to donate a cup of coffee I will write it in a modification for you.
https://www.youtube.com/watch?v=zXIxDoCRc84
by mona wrote: ↑Tue Jul 13, 2021 5:15 pmyou could just do this:
add a private function to the class system/library/mail/smtp.php
then change in that same file the calls of:Code: Select all
// return base64 encoded if needed ($item not ASCII) private function mailb64_if_required ($item) { return (!mb_check_encoding($item, 'ASCII') ? '=?UTF-8?B?' . base64_encode($item) . '?=' : $item); }
toCode: Select all
$header .= 'Subject: =?UTF-8?B?' . base64_encode($this->subject) . '?=' . PHP_EOL;
Code: Select all
$header .= 'Subject: ' . $this->mailb64_if_required($this->subject) . PHP_EOL;
toCode: Select all
$header .= 'From: =?UTF-8?B?' . base64_encode($this->sender) . '?= <' . $this->from . '>' . PHP_EOL;
Code: Select all
$header .= 'From: ' . $this->mailb64_if_required($this->sender) . ' <' . $this->from . '>' . PHP_EOL;
toCode: Select all
$header .= 'Reply-To: =?UTF-8?B?' . base64_encode($this->sender) . '?= <' . $this->from . '>' . PHP_EOL;
Code: Select all
$header .= 'Reply-To: ' . $this->mailb64_if_required($this->sender) . ' <' . $this->from . '>' . PHP_EOL;
toCode: Select all
$header .= 'Reply-To: =?UTF-8?B?' . base64_encode($this->sender) . '?= <' . $this->reply_to . '>' . PHP_EOL;
Code: Select all
$header .= 'Reply-To: ' . $this->mailb64_if_required($this->sender) . ' <' . $this->reply_to . '>' . PHP_EOL;
So you do not have to constantly do:keeps it clean.Code: Select all
if (mb_check_encoding($this->xxxxxx, 'ASCII')) { } else { }
Any help would be really appreciated.
That code doesn't add a message-id header. It probably just lowers the spam score. Any decent host should add the message-id header if it's not there. Maybe ask you host about it.rufus.d wrote: ↑Sat Jan 27, 2024 10:33 pmIs there any similar solution for Marketing -> Mails (To send emails to newsletter subscribers). The below modification fixed the issue for all emails, except the one under the marketing. When sent, it's sending without a message-id header and marks as SPAM, which doesn't even reach the user.
Any help would be really appreciated.
I did link to someone else's change that did add a message-id header.
viewtopic.php?p=866184#p824826
I would recommend sending from MailChimp using Clear Thinking's excellent extension.
UK OpenCart Hosting | OpenCart Audits | OpenCart Support - please email info@antropy.co.uk
by mona wrote: ↑Tue Jul 13, 2021 5:15 pmyou could just do this:
add a private function to the class system/library/mail/smtp.php
then change in that same file the calls of:Code: Select all
// return base64 encoded if needed ($item not ASCII) private function mailb64_if_required ($item) { return (!mb_check_encoding($item, 'ASCII') ? '=?UTF-8?B?' . base64_encode($item) . '?=' : $item); }
toCode: Select all
$header .= 'Subject: =?UTF-8?B?' . base64_encode($this->subject) . '?=' . PHP_EOL;
Code: Select all
$header .= 'Subject: ' . $this->mailb64_if_required($this->subject) . PHP_EOL;
toCode: Select all
$header .= 'From: =?UTF-8?B?' . base64_encode($this->sender) . '?= <' . $this->from . '>' . PHP_EOL;
Code: Select all
$header .= 'From: ' . $this->mailb64_if_required($this->sender) . ' <' . $this->from . '>' . PHP_EOL;
toCode: Select all
$header .= 'Reply-To: =?UTF-8?B?' . base64_encode($this->sender) . '?= <' . $this->from . '>' . PHP_EOL;
Code: Select all
$header .= 'Reply-To: ' . $this->mailb64_if_required($this->sender) . ' <' . $this->from . '>' . PHP_EOL;
toCode: Select all
$header .= 'Reply-To: =?UTF-8?B?' . base64_encode($this->sender) . '?= <' . $this->reply_to . '>' . PHP_EOL;
Code: Select all
$header .= 'Reply-To: ' . $this->mailb64_if_required($this->sender) . ' <' . $this->reply_to . '>' . PHP_EOL;
So you do not have to constantly do:keeps it clean.Code: Select all
if (mb_check_encoding($this->xxxxxx, 'ASCII')) { } else { }
Hi i dont have this code "$header .= 'Reply-To: =?UTF-8?B?' . base64_encode($this->sender) . '?= <' . $this->reply_to . '>' . PHP_EOL;"
i have this code "$header .= 'Reply-To: =?UTF-8?B?' . base64_encode($this->reply_to) . '?= <' . $this->reply_to . '>' . PHP_EOL;"
Im Running opencart 3.0.3.8
Users browsing this forum: Google [Bot], neutrimous and 216 guests