Forums / General Questions / Blank Message ID: in sent emails

Blank Message ID: in sent emails

Views: 2,316

Results 1 to 14 of 14
17 Jan 2015, 8:27 PM
#1
sstreich avatar

sstreich

New Zenner

Join Date:
Nov 2014
Location:
PA
Posts:
36
Plugin Contributions:
0

Blank Message ID: in sent emails

I am having an issue with emails being denied due to a incomplete Message ID in sent email.
This is only happening with ZC.
Message-ID: <97f5847a3eecf6b9d3c965ac1c54ae40@>
for some reason I cannot figure out it's not adding the domain at the end.
I've went through everything I could find to see what I missed and cannot locate this problem without advice.
I've checked my mail server by sending from the server and relaying from my desktop,
Desktop: Message-ID: [email protected]
Server: Message-Id: [email protected]

For some reason ZC is just not adding the domain.
I've already tried disabling Known server in admin and re enabling it currently it set to true.
I've went through the PHP settings, they all tested okay.
I've tried switching between PHP, Qmail, Sendmail MTAs in the admin.
I am running qmail as my mta.

18 Jan 2015, 1:56 AM
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Blank Message ID: in sent emails

Have you tried smtp, smtp-auth or any of the other protocols besides php?

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

18 Jan 2015, 3:02 AM
#3
sstreich avatar

sstreich

New Zenner

Join Date:
Nov 2014
Location:
PA
Posts:
36
Plugin Contributions:
0

Re: Blank Message ID: in sent emails

Yes Tried them all. Even set up the domain name directly in php.ini file.
It not coming from a installed plugin, as I went back and checked all order emails since I first brought it online which would be before any additional plugins were installed.

18 Jan 2015, 6:50 AM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Blank Message ID: in sent emails

phpMailer handles everything related to assembling the headers and message ID details etc. That's not something Zen Cart itself touches in any way. You might take your inquiry to them

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

18 Jan 2015, 5:42 PM
#5
sstreich avatar

sstreich

New Zenner

Join Date:
Nov 2014
Location:
PA
Posts:
36
Plugin Contributions:
0

Re: Blank Message ID: in sent emails

I actually have this working now. Not what I wanted but it's working until I can figure out the correct method.
To test whether it was my server or another issue, I switched the smtpauth to an off site mail server, which worked.
So this says it was my system.
In case anyone else has this issue.
I am running Qmail w/ tcp
It would send to any internal address without an issue, however it would give me a not in the rcphosts error for out going mail.
Solution was to add the servers own IP to the TCP smtp file ie: ###.###.###.##:allow,RELAYCLIENT=""

I'll take your advice and check with phpmailer, I would like to use that instead of smtpauth. The Phpmailer used with Joomla/Virtuemart worked fine

18 Jan 2015, 6:48 PM
#6
sstreich avatar

sstreich

New Zenner

Join Date:
Nov 2014
Location:
PA
Posts:
36
Plugin Contributions:
0

Re: Blank Message ID: in sent emails

To get PHPmailer to add the domain name to the message ID.
in includes/classes/class.phpmailer.php
I found this section:
/**

  • Sets the hostname to use in Message-Id and Received headers
  • and as default HELO string. If empty, the value returned
  • by SERVER_NAME is used or 'localhost.localdomain'.
  • @var string
    */
    public $Hostname = ' ';
    and changed the public $Hostname = ' '; to public $Hostname = 'mydomain.com ';

I am sure this isn't the correct way it should be done- and will need to changed again after and upgrade, but for now it works great!

18 Jan 2015, 6:51 PM
#7
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Blank Message ID: in sent emails

Given that you're the first to ever report having this issue, it sounds like an issue unique to your MTA setup, perhaps specifically qmail.

Further, since it's unique to your site, putting the change in that location is probably the best approach. You can re-do the same again whenever you change that file again in the future, such as during an upgrade.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

18 Jan 2015, 7:05 PM
#8
sstreich avatar

sstreich

New Zenner

Join Date:
Nov 2014
Location:
PA
Posts:
36
Plugin Contributions:
0

Re: Blank Message ID: in sent emails

I do have quite a few spam blocking programs tied in with my qmail one of those may be the culprit- I HATE spam
I didn't like the authsmtp as it added www to the message id so by hardcoding the domain directly into the mailer I am getting what I actually want.
Maybe there should be an option in the admin>E Mail option to add the domain name as a separate value ??

18 Jan 2015, 8:40 PM
#9
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Blank Message ID: in sent emails

SStreich:

Maybe there should be an option in the admin>E Mail option to add the domain name as a separate value ??
Perhaps, but shouldn't you configure the server properly instead?
ie:
SStreich:

/**

  • Sets the hostname to use in Message-Id and Received headers
  • and as default HELO string. **If empty, the value returned
  • by SERVER_NAME is used** or 'localhost.localdomain'.
  • @var string
    */
    public $Hostname = ' ';
    ie: I would think that configuring your webserver (ie: your unique combination of PHP and Apache/whatever) so that PHP gets a valid SERVER_NAME response might be in keeping with how this says it's intended to work.
    Further, if the phpMailer folks aren't willing to explain the technical parts of it to you, then you could study the code further to understand exactly what the code does when the Hostname var is blank, and that could inform your actions taken to configure your server even better.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

19 Jan 2015, 1:57 AM
#10
sstreich avatar

sstreich

New Zenner

Join Date:
Nov 2014
Location:
PA
Posts:
36
Plugin Contributions:
0

Re: Blank Message ID: in sent emails

Yes you are right- however what I was referring to is the choice of using an alias. My reasons being:
With the usage of calling the localdomain you'll get www, demo, test, or what ever you have as an alias, as in my case I have used store.mydomain.com, demo.mydomain.com, wholesale.mydomain.com , https://www.mydomain.com. etc. With an option to select what should actually be used in the mail options choices of what to enter as the domain would be a more convenient way to set it up.
I've seen many emails over time that when you try to reply to they bounce as they have an alias in the return, or they bounce from the start.
I really don't think I am the only one that had this problem, It took me over a month to actually find it and pin it down. The responses I was getting back from some of the mail server like Google gave no indication that this was the reason they weren't being accepted.
This is the response I was getting from google: deferral: 74.125.22.27_failed_after_I_sent_the_message./Remote_host_said:421-4.7.0[141.158.210.46##########_15]_Our_system_has_detected_an_unusual_rate_of/421-4.7.0_unsolicited_mail_originating_from_your_IP_address._To_protect_our/421-4.7.0_users_from_spam,_mail_sent_from_your_IP_address_has_been_temporarily/421-4.7.0_rate_limited._Please_visit/421-4.7.0_http://www.google.com/mail/help/bulk_mail.html_to_review_our_Bulk/421_4.7.0_Email_Senders_Guidelines._o1si7895348qcf.43_-_gsmtp/
And spending few days testing and reading trough the google guidelines there is not one mention of a malformed message id:
Someone without full admin access to their server isn't going to be able to track this down, or even know there is an issue. These messages are in the mail send logs only, they weren't showing up as bounces or anywhere a regular user is going to have access to on a hosted server.
And to make matters even more hard to track it down, is not all mail servers will reject the email due to this. I've only seen 5-6 that do, the rest accepted them.
Before switching to this much much better cart I used joomla/virtuemart with their stock phpmailer, If I recall correctly there was an option in that to set a domain name in the mailer? Phpmailer was the about the only thing that did work right with VM :-))
Anyway users having an issue with mail not going through you may also have them double check this also, as you do an excellent job helping and giving good advice.

19 Jan 2015, 2:34 AM
#11
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Blank Message ID: in sent emails

If you prefer not to touch the class.phpmailer.php file, you could edit /includes/functions/functions_email.php , around line 336 (circa ZC v1.5.4),
inserting something like the highlighted code below:

      $ErrorInfo = '';
      $mail->Hostname = preg_replace('~(^https?://|\/.*$)~', '', defined('HTTP_CATALOG_SERVER') ? HTTP_CATALOG_SERVER : HTTP_SERVER);
      $zco_notifier->notify('NOTIFY_EMAIL_READY_TO_SEND', array($mail), $mail);

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

19 Jan 2015, 3:12 AM
#12
sstreich avatar

sstreich

New Zenner

Join Date:
Nov 2014
Location:
PA
Posts:
36
Plugin Contributions:
0

Re: Blank Message ID: in sent emails

If I read this correctly you wouldn't have the option to use the alias should anyone wish to use it ???
Then if a domain was already set domain.com (no alias) wouldn't you wind up with just com as the domain?
Or am I misreading the call: https?://|', (ignores things in the first section of the domain)
My PTR is mail.mydomain.com
I was actually looking at doing something similar to this,(if statements) but was afraid of breaking it completely. And then just editing one line in class.phpmailer.php made it seems so much easier.

19 Jan 2015, 3:15 AM
#13
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Blank Message ID: in sent emails

No, the "s?" means "if there's an "s" include it in the pattern".

The whole line means: "using either HTTP_CATALOG SERVER (only available admin-side) or HTTP_SERVER, strip off the http:// or https:// from the front and anything after any other remaining '/' characters, leaving just the store's domain name", and pass that to phpMailer as the Hostname parameter.

You can test regexes at http://regexpal.com/

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

19 Jan 2015, 3:36 AM
#14
sstreich avatar

sstreich

New Zenner

Join Date:
Nov 2014
Location:
PA
Posts:
36
Plugin Contributions:
0

Re: Blank Message ID: in sent emails

Thanks for explaining that- it now makes sense to me.
I've been working with perl/cgi scripts for years and am finding it very difficult to grasp the php at times. It'd be alot easier if they weren't similar yet so different.