Answers.Body: <p>A workaround is to change the root civicrm token to an absolute path
  (Credit due to Eli Lisseck for research and workaround solution)</p>
  
  <p>Under Resource URLs, change CiviCRM Resource URL from [civicrm.root]/ to sites/all/modules/civicrm/</p>
  
  <p>(Note that civicrm.settings.php has the following setting for sites that work correctly and sites that do not work correctly.
  $civicrm_root = '/var/www/html/sites/all/modules/civicrm';)</p>
  
  <p>So, while this appears to be a workaround, it is hiding the "root" problem.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-07-07T19:43:51.140Z
Answers.LastActivityDate: 2017-07-07T20:00:25.000Z
Answers.LastEditDate: 2017-07-07T20:00:25.000Z
Answers.UserDisplayName: Dave T
Body: <p>Civimail is inserting a path for the open tracking image that includes var/www/html</p>
  
  <p>example where it does not work <a href="https://(domain.org)/var/www/html/sites/all/modules/civicrm/extern/open.php?q=nnnn" rel="nofollow noreferrer">https://(domain.org)/var/www/html/sites/all/modules/civicrm/extern/open.php?q=nnnn</a></p>
  
  <p>for some mailings the path is correct:
  <a href="https://(domain.org)/sites/all/modules/civicrm/extern/open.php?q=nnnn" rel="nofollow noreferrer">https://(domain.org)/sites/all/modules/civicrm/extern/open.php?q=nnnn</a></p>
  
  <p>The tracking works when I manually remove the var/www/html from the path for a given url and the open report shows the open</p>
  
  <p>There have been no changes to the default directory or resource paths.</p>
  
  <p>Anyone else see this behavior?  It seems to have started in November (2016) but is inconsistent.  Any suggestions on where to look?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-12-11T18:52:19.047Z
Comments.Text: Hi, Dave, what is the version of CiviCRM you are using and did you do an upgrade in November?
Comments.UserDisplayName: Kainuk - CiviCooP
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-12-11T22:55:08.773Z
Comments.Text: This issue might be of interest - https://issues.civicrm.org/jira/browse/CRM-19303 - might be a change to how CiviCRM obtains that image path relative to the site root / civicrm root.
Comments.UserDisplayName: Chris Burgess
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-12-12T18:46:57.543Z
Comments.Text: It showed up first on 4.7.12 and continues (today) on 4.7.14
Comments.UserDisplayName: Dave T
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-12-12T18:48:29.593Z
Comments.Text: further testing seems to point to mailings that either start with a message template OR are re-uses of prior mailings.  Perhaps the code that inserts the tracking image is broken or overriden by the use of prior content.    I think the different path is interesting.  Maybe the tokenization of paths has something to do with it - if the template or re-use code is not using the path tokens correctly?
Comments.UserDisplayName: Dave T
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-03-11T12:59:27.373Z
Comments.Text: This problem continues.  Recent investigation shows that the problem is related to the use of click through tracking.  When click tracking is enabled, non custom url's (those without a cid, for example) are also incorrectly formed with the same addition of var/www/html path as the open tracking image.   When the click through tracking option is turned off, open tracking does work as well as non-custom URLs.
Comments.UserDisplayName: Dave T
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-03-11T13:00:39.353Z
Comments.Text: Also, I cannot find a simple way to change the default option for click tracking.   Each mailing needs to be changed individually to avoid the problem shown above.
Comments.UserDisplayName: Dave T
Tags: <civimail>
Title: Civimail open tracking is not working for some mailings - inserts var/www/html into path for some mailings but not others
ThreadText: # Civimail open tracking is not working for some mailings - inserts var/www/html into path for some mailings but not others
  
  (Asked by: username_0 on 2016-12-11)
  
  Civimail is inserting a path for the open tracking image that includes var/www/html
  
  example where it does not work <https://(domain.org)/var/www/html/sites/all/modules/civicrm/extern/open.php?q=nnnn>
  
  for some mailings the path is correct:
  <https://(domain.org)/sites/all/modules/civicrm/extern/open.php?q=nnnn>
  
  The tracking works when I manually remove the var/www/html from the path for a given url and the open report shows the open
  
  There have been no changes to the default directory or resource paths.
  
  Anyone else see this behavior? It seems to have started in November (2016) but is inconsistent. Any suggestions on where to look?
  
  **Tags:** civimail
  
  > **Comments:**
  > **username_1**: Hi, Dave, what is the version of CiviCRM you are using and did you do an upgrade in November?  
  > **username_2**: This issue might be of interest - https://issues.civicrm.org/jira/browse/CRM-19303 - might be a change to how CiviCRM obtains that image path relative to the site root / civicrm root.  
  > **username_0**: It showed up first on 4.7.12 and continues (today) on 4.7.14  
  > **username_0**: further testing seems to point to mailings that either start with a message template OR are re-uses of prior mailings.  Perhaps the code that inserts the tracking image is broken or overriden by the use of prior content.    I think the different path is interesting.  Maybe the tokenization of paths has something to do with it - if the template or re-use code is not using the path tokens correctly?  
  > **username_0**: This problem continues.  Recent investigation shows that the problem is related to the use of click through tracking.  When click tracking is enabled, non custom url's (those without a cid, for example) are also incorrectly formed with the same addition of var/www/html path as the open tracking image.   When the click through tracking option is turned off, open tracking does work as well as non-custom URLs.  
  > **username_0**: Also, I cannot find a simple way to change the default option for click tracking.   Each mailing needs to be changed individually to avoid the problem shown above.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2017-07-07. Score: 3
  
  A workaround is to change the root civicrm token to an absolute path
  (Credit due to Eli Lisseck for research and workaround solution)
  
  Under Resource URLs, change CiviCRM Resource URL from [civicrm.root]/ to sites/all/modules/civicrm/
  
  (Note that civicrm.settings.php has the following setting for sites that work correctly and sites that do not work correctly.
  $civicrm\_root = '/var/www/html/sites/all/modules/civicrm';)
  
  So, while this appears to be a workaround, it is hiding the "root" problem.
  
  
  ---
  
  