CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Outputting to file
Pages: [1]

Author Topic: Outputting to file  (Read 3261 times)

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Outputting to file
May 12, 2008, 02:21:52 pm
We've been seeing an intermittent issue where recipients of CiviMail receive an email with the middle of an HTML mail omitted (the beginning ~775 chars and a block at the end will be included).

We've seen it affect some (but not all) emails on various domains.

Donald, at the NZ meetup you mentioned a method for making CiviMail send a job to file outputs in a directory, instead of sending via SMTP. Can you remind me how I can do this please?

Would love to be able to identify where the issue is. It affects a small number (but enough to hear about it - so maybe not so small) of recipients to all our mailouts so far.
@xurizaemon ● www.fuzion.co.nz

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Outputting to file
May 12, 2008, 02:36:41 pm

the below is for TESTING only. do not use in production (no mails will be sent). The setting you can use in your civicrm.settings.php file is:

define( 'CIVICRM_MAIL_LOG' , '/dev/null' );  // sends mail to /dev/null
define( 'CIVICRM_MAIL_LOG' , 1 ); // puts a copy of all mails sent in uploadDir/mail/*. uses a md5 hash to name the files

all mail sent via civicrm respects the above settings. so use with care :)

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: Outputting to file
May 12, 2008, 04:13:21 pm
Thanks Lobo.

Something I omitted to mention was that the truncation affects only the message body; it will get cut off, but the footer will then be appended to the truncated message.

For this reason, I am fairly confident the issue is within CiviMail - and not in some later stage (because the mail systems that deliver the message would have no reason to treat the separation between message body and footer as a special case).

I'll debug this some more once this evening.
@xurizaemon ● www.fuzion.co.nz

Piotr Szotkowski

  • Moderator
  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Outputting to file
May 13, 2008, 04:47:48 am
Is there any chance that the truncated body happens to be all in a single line? IIRC, there are SMTP implementations that simply cut off lines longer than X characters (where X is some large three-digit number).
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

petednz

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4899
  • Karma: 193
    • Fuzion
  • CiviCRM version: 3.x - 4.x
  • CMS version: Drupal 6 and 7
Re: Outputting to file
May 13, 2008, 12:39:22 pm
In one case the cut off occurred about 5 characters in to a 12 character line
Rank        Name
1   Jeanette Fitzsimons     
2   Russel Norman               
3   Sue Bradford                 
4   Metiria    Turei

Became

Rank        Name
1   Jeanette Fitzsimons     
2   Russel Norman               
3   Sue Bradford                 
4   Met

In the other

Event: Shopping with Sue
When: Thurs 8 May 10.15am

became

Event: Shopping with Sue
W
Sign up to StackExchange and get free expert advice: https://civicrm.org/blogs/colemanw/get-exclusive-access-free-expert-help

pete davis : www.fuzion.co.nz : connect + campaign + communicate

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: Outputting to file
May 13, 2008, 01:40:25 pm
Quote from: Donald Lobo on May 12, 2008, 02:36:41 pm
define( 'CIVICRM_MAIL_LOG' , '/dev/null' );  // sends mail to /dev/null
define( 'CIVICRM_MAIL_LOG' , 1 ); // puts a copy of all mails sent in uploadDir/mail/*. uses a md5 hash to name the files

all mail sent via civicrm respects the above settings. so use with care :)

I don't get it. I tested on a standard (download of 2.0.3 tgz from SF) install and this define works as expected with CiviMail.

However, on our SVN (r14412) version, adding this to civicrm.settings.php still results in mails sent from CiviMail being delivered by SMTP:
Code: [Select]
define( 'CIVICRM_MAIL_LOG' , 1 );

I did capture a receipt from CiviContribute using the same setting. Is it possible that CiviMail only could ignore this setting?

Or perhaps it's because I'm re-using an existing mail?

solved

The reason my debug wasn't working was that civimail.cronjob.php requires the settings_location.php file in the CiviCRM root directory to be set correctly. Because I'd recently moved the site files, this was pointing to my old settings location, so when cron fired off the sends for CiviMail, the debug wasn't defined. CiviMail documentation on settings_location.php is here. Thanks Donald for helping me solve this.
« Last Edit: May 13, 2008, 02:58:57 pm by xurizaemon »
@xurizaemon ● www.fuzion.co.nz

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: Outputting to file
May 13, 2008, 03:54:26 pm
Ah ... we've identified that the issue appears to be specific to addresses within domains paradise.net.nz or clear.net.nz

This ISP (same mailserver for both domains) identifies their mailserver as "CLEAR Net Mail"

I'll follow up if we find any instances where this affects someone outside those domains.
@xurizaemon ● www.fuzion.co.nz

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: Outputting to file
May 18, 2008, 10:16:32 pm
Quote from: Piotr Szotkowski on May 13, 2008, 04:47:48 am
Is there any chance that the truncated body happens to be all in a single line? IIRC, there are SMTP implementations that simply cut off lines longer than X characters (where X is some large three-digit number).

Nail on the head, Piotr. RFC2821 (4.5.3.1) specifies a maximum line length of 1000chars for any message body line. The Dojo HTML editor doesn't insert linefeeds at all in the HTML, so this results in truncated messages by any mailserver which puts the brakes on at 1000chars.

I'm having a look to see if it's easily fixable.

Thanks
@xurizaemon ● www.fuzion.co.nz

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: Outputting to file
May 18, 2008, 10:45:53 pm
... or so I thought.

Mails to file issue ends here; I'll start a new thread for this odd problem I'm seeing.

http://forum.civicrm.org/index.php/topic,3411.0.html
« Last Edit: May 18, 2008, 10:53:28 pm by xurizaemon »
@xurizaemon ● www.fuzion.co.nz

Piotr Szotkowski

  • Moderator
  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Outputting to file
May 19, 2008, 01:31:44 am
Quote from: xurizaemon on May 18, 2008, 10:16:32 pm
Quote from: Piotr Szotkowski on May 13, 2008, 04:47:48 am
Is there any chance that the truncated body happens to be all in a single line? IIRC, there are SMTP implementations that simply cut off lines longer than X characters (where X is some large three-digit number).

Nail on the head, Piotr. RFC2821 (4.5.3.1) specifies a maximum line length of 1000 chars for any message body line. The Dojo HTML editor doesn't insert linefeeds at all in the HTML, so this results in truncated messages by any mailserver which puts the brakes on at 1000chars.

I'm having a look to see if it's easily fixable.

We should wrap the lines coming from the Dōjō anyway, then. CRM-3133 filed.
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

Chris Burgess

  • Ask me questions
  • ****
  • Posts: 675
  • Karma: 59
Re: Outputting to file
May 19, 2008, 02:06:39 pm
Your suggested fix tested and worked for us - emails displayed normally when sent via the mailserver which was chopping them (and via all normal routes as well).

I added a patch which incorporates your wordwrap() addition to CRM-3133

It only affects CRM/Mailing/BAO/Mailing.php - I'm sure there are other places the same fix might need to be applied. (I assume we don't modify code in the packages/ tree?)
@xurizaemon ● www.fuzion.co.nz

Piotr Szotkowski

  • Moderator
  • I live on this forum
  • *****
  • Posts: 1497
  • Karma: 57
Re: Outputting to file
May 20, 2008, 12:04:52 am
Quote from: xurizaemon on May 19, 2008, 02:06:39 pm
Your suggested fix tested and worked for us - emails displayed normally when sent via the mailserver which was chopping them (and via all normal routes as well).

Thanks for testing this! Lobo fixed this in r14556.

Quote from: xurizaemon on May 19, 2008, 02:06:39 pm
It only affects CRM/Mailing/BAO/Mailing.php - I'm sure there are other places the same fix might need to be applied. (I assume we don't modify code in the packages/ tree?)

We do when we need (like in this case), keeping the original file in packages.orig (so we can diff for our changes on packages upgrades).
If you found the above helpful, please consider helping us in return – you can even steer CiviCRM’s future and help us extend CiviCRM in ways useful to you.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviMail (Moderator: Piotr Szotkowski) »
  • Outputting to file

This forum was archived on 2017-11-26.