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 »
  • Installing CiviCRM »
  • CiviMail installation and configuration (Moderator: Donald Lobo) »
  • Bounce: Could not extract the mail body
Pages: [1]

Author Topic: Bounce: Could not extract the mail body  (Read 1579 times)

lottie

  • I’m new here
  • *
  • Posts: 11
  • Karma: 0
  • CiviCRM version: 4.5
  • CMS version: Drupal 7
  • MySQL version: 5.1
  • PHP version: 5.4
Bounce: Could not extract the mail body
October 25, 2014, 06:26:26 pm
Hello,

I am attempting to configure CiviMail Return-Channel. I have configured and tested the outbound account. And I have setup an account for bounce processing. I have read a number of installation instructions including the book.civicrm.org and a number of forum discussions but I can't seem to resolve the latest issue I'm encountering.

I can send mass email mailings. And I receive them just fine. The correct email address is shown for the return path.

When I attempt to use an incorrect email (joh@example.com or john@exaple.com - replaced with my email addresses), I receive the bounce email in the return email account. And when I look at the contents of one of the returns, the code is 550. When I run Fetch Bounces, the email is correctly moved from Successful Deliveries to Bounces in the CiviMail Report and the Bounce Type is listed as Syntax, but the Bounce Reason is listed as: "We could not extract the mail body from this bounce message."

I've attempted this using an account on my server and then attempted it using an account on gmail, both with the same result.

Fetch Bounces does not have any errors:

Parameters parsed (and passed to API method):
a:1:{s:7:"version";i:3;}

Full message:
Finished execution of Fetch Bounces with result: Success (a:0:{})

No Civi errors.

exim_paniclog shows the following after Fetch bounce:
[5883] User 0 set for local_delivery transport is on the never_users list

Any help is appreciated.

Drupal 7
CiviCRM 4.4.x
« Last Edit: October 26, 2014, 10:51:24 am by lottie »

questions

  • I post occasionally
  • **
  • Posts: 79
  • Karma: 2
  • CiviCRM version: 4.4.6
  • CMS version: Durpal, 7
  • MySQL version: 5.1
  • PHP version: 5.3
Re: Bounce: Could not extract the mail body
October 26, 2014, 08:31:26 pm
I'm having the same problem.

In my case, it was all working fine.  We moved servers and upgraded.  Then noticed it wasn't really processing bounced messages.

I added some debug statements to EmailProcessor.php.  As far as I can tell $mail->generateBody() always comes back null.

If I do a CRM_Core_Error::debug( 'top', array('mail'=> $mail),true,true );  I can see that all the header, subject, etc. are there but the body text is empty.  It seems to know it's ascii and creates all the arrays and such for the body but no detail.  What would cause it to parse the header info fine and skip the body?

Any clues on how to debug this further?


lottie

  • I’m new here
  • *
  • Posts: 11
  • Karma: 0
  • CiviCRM version: 4.5
  • CMS version: Drupal 7
  • MySQL version: 5.1
  • PHP version: 5.4
Re: Bounce: Could not extract the mail body
October 27, 2014, 04:36:35 am
Additional information:
The problem seems to be located in /civicrm/packages/ezc/Mail/src/parser/parts/text_parser.php - public function finish() - line 102:
       
        $this->text = ezcMailCharsetConverter::convertToUTF8( $this->text, $charset );

Prior to this the body text exists but once it is "converted," $this->text = bool(false).

The problems may be connected to the fact that Content-Type does not get set in /civicrm/packages/ezc/Mail/src/parser/parts/rfs822_parser.php - public function parseBody() - line 82, so it remains NULL.

This causes $charset in text_parser.php - public function finish() - line 79 to be set to "us-ascii". Whereas, when the Content-Type is set, in my case to "utf-8", in rfs822_parser.php, the Bounce Reason is set properly as well.
« Last Edit: November 08, 2014, 03:21:56 pm by lottie »

questions

  • I post occasionally
  • **
  • Posts: 79
  • Karma: 2
  • CiviCRM version: 4.4.6
  • CMS version: Durpal, 7
  • MySQL version: 5.1
  • PHP version: 5.3
Re: Bounce: Could not extract the mail body
October 27, 2014, 09:14:43 am
Well, Lottie you are several steps ahead of me.  Thank you.  (I'm not sure I could have traced it this far through.)  I see the exact same thing.  If I force the charset to be uft-8, it works.

For some reason it is not getting the content type, yet it's clearly there in the message. 

The odd thing is this package is a standard package and getting content-type seems like it's kind of a basic thing, so I kind of think the problem is some sort of configuration thing or missing (not installed) program on the server side. 

Have you gotten any farther? 

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: Bounce: Could not extract the mail body
October 27, 2014, 09:48:13 am

hey lottie:

great investigation and debugging. Can you continue with your experiments and:

a:figure out why the charset is not being set properly by ezc by following the code

OR

b: check with the ezc folks on their support channel

thanx

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

lottie

  • I’m new here
  • *
  • Posts: 11
  • Karma: 0
  • CiviCRM version: 4.5
  • CMS version: Drupal 7
  • MySQL version: 5.1
  • PHP version: 5.4
Re: Bounce: Could not extract the mail body
October 27, 2014, 11:43:30 am
questions, you helped steer me down the road - so thank you. I too am wondering if I missed something in configuration since I am running a standard package.

lobo, how do I get in touch with ezc folks on their support channel? is this an IRC channel or elsewhere? thank you
« Last Edit: October 27, 2014, 12:06:25 pm by lottie »

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: Bounce: Could not extract the mail body
October 27, 2014, 12:28:41 pm

Sorry, i dont know this info right now. You'll need to check their website and see the support options they have

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

questions

  • I post occasionally
  • **
  • Posts: 79
  • Karma: 2
  • CiviCRM version: 4.4.6
  • CMS version: Durpal, 7
  • MySQL version: 5.1
  • PHP version: 5.3
Re: Bounce: Could not extract the mail body
October 27, 2014, 12:35:55 pm
It looks like you can go here

http://ezcomponents.org/support/irc

Just to make sure there was nothing in the actually message and because it was real easy to test, I reprocessed a message from before we moved servers and I know worked.  It did the same thing so it's nothing to do with the actual message.  I didn't think it would be but...

It's interesting in some places in the exmail code they say create message with us-ascii always parse messages with utf-8, yet they don't.

Lobo do you know if anything in the ezc package was changed between 3.4.7 and 4.4.6 or is there an easy way for me to see?

questions

  • I post occasionally
  • **
  • Posts: 79
  • Karma: 2
  • CiviCRM version: 4.4.6
  • CMS version: Durpal, 7
  • MySQL version: 5.1
  • PHP version: 5.3
Re: Bounce: Could not extract the mail body
October 27, 2014, 10:27:06 pm
I think I'm getting somewhere.  The parser stuff uses iconv to convert.  It uses the iconv function of php.  Some implimentations of iconv doesn't do what is expected.  What I think is expected is it returns the converted text until it comes across a character it can't handle.  In our version and I'm guessing in lottie's as well, it returns nothing.

I've run across somethings that say

"Some PHP CMS's will default setlocale to 'C', this can be a problem.  use the "locale" command to find out a list..  $ locale -a"

On our server it comes back with C as the first item.  I'll have to play with setting it to something else.

Next the mail program is qmail.  Qmail doesn't bother to give the content-type in it's headers.  I think the standard is if nothing is given it's us-ascii, but then qmail appends the original message which is other types.  I think if the parser sees multipart in the top header it then looks for the different parts and parses for content_type.  Well qmail again doesn't set that so I'm guessing the parser never gets far enough down into the message to find the content type of the appended original message so it doesn't get set.  As far as processing the bounces, we don't care about the original message so when it stops on the utf-8 characters it can't convert, no one notices.  Well, unless it returns nothing like it does on our server.

I personally think that ezcomponents shouldn't default the content_type to us-ascii in text_parser.php if it doesn't find anything.  I think us-ascii is pretty much a subset of most other char sets.  It's eventually going to convert things to utf-8.   I believe they should set it to "unknown-8bit" which they do support in their iconv call.  If the charset is unkonwn-8bit, they set the char set to latin1 (ISO-8859-1), which if I understand correctly has a char or a substitution for all possible chars from whatever char set.  (BTW, changing the default works)

Oh, our server is running:
Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux. 
PHP 5.5.9-1ubuntu4.4
iconv implementation    glibc
iconv library version    2.19

Jon-man

  • I’m new here
  • *
  • Posts: 19
  • Karma: 1
  • Supporting voluntary action since 1975
  • CiviCRM version: 4.4.6
  • CMS version: Drupal 7.28
  • MySQL version: 5.1.68-cll
  • PHP version: 5.3.18
Re: Bounce: Could not extract the mail body
December 09, 2014, 06:23:49 am
Was there any resolution around this issue? We're using PHP mail()

We're experiencing the same and the bounce rate has gone up from 0% to almost 10% after a server migration.

thanks,
Jon-man
+44 (0)161 2771020

adixon

  • I post frequently
  • ***
  • Posts: 314
  • Karma: 19
    • Blackfly Solutions
Re: Bounce: Could not extract the mail body
December 09, 2014, 07:03:29 am
Are you sure you have the same issue? I suggest you start a new topic and post the specific details. There are lots of different reasons for bounce rates to change.

Your case sounds like the opposite - in the past your 0% was probably a failure to process the bounces.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • CiviMail installation and configuration (Moderator: Donald Lobo) »
  • Bounce: Could not extract the mail body

This forum was archived on 2017-11-26.