How to decode base64 PHP code igniter

base64_encode - php base64url

I am analyzing emails with Zend_Mail, and strangely enough, some content is truncated and the email portions are improperly formatted for no apparent reason.

For example

Will be shortened to ...

A var_dump on each line indicates this.

or in another email to

I can't figure out why I'm stopping there. Transfers should only end at the end of the line. This is the line that gets the string from the IMAP server.

The encoded text contains a string of characters which in turn is truncated in different parts in different emails.

I tried adding a size to fgets () but no results. I also enabled / disabled the "php_ini" setting of "auto_detect_line_endings", again with no result.

I also opened a bug report with ZF even though the bug doesn't seem to be in the library.

Do you see anything strange with this encoded string?


New research shows that emails are cut off after 584 characters. I still don't know why. Sent a question to Google. Look here .

A Bad Email Headers:

For those who are interested in an answer and not in the (ex) premium, more pointers.

Gmail returns a short value in response to RFC822.SIZE which can result in truncated messages (you are off to count one byte for each header line, apparently not counting two characters for CR / LF).